feat: establish the bounded production architecture
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "app_config.h"
|
||||
#include "game_types.h"
|
||||
|
||||
typedef uint8_t command_type_t;
|
||||
enum { COMMAND_CONFIG, COMMAND_START, COMMAND_SHOT, COMMAND_REMATCH, COMMAND_ABORT };
|
||||
typedef struct { command_type_t type; uint8_t session_index; uint32_t game_id; uint32_t version; coordinate_t coordinate; game_mode_t mode; } app_command_t;
|
||||
typedef struct { app_command_t entries[kCommandQueueCapacity]; uint8_t head; uint8_t tail; uint8_t count; } command_queue_t;
|
||||
|
||||
bool command_queue_push(command_queue_t *queue, const app_command_t *command);
|
||||
bool command_queue_pop(command_queue_t *queue, app_command_t *command);
|
||||
_Static_assert(sizeof(command_queue_t) <= 320, "command queue grew beyond fixed budget");
|
||||
Reference in New Issue
Block a user