Moved size defines to plat_compat

This commit is contained in:
2017-12-25 13:47:50 +01:00
parent 8ded459c68
commit bef9b83826
11 changed files with 90 additions and 55 deletions
+68
View File
@@ -5,6 +5,74 @@
#ifndef GEX_PLAT_COMPAT_H
#define GEX_PLAT_COMPAT_H
// -------- Buffers and stack sizes ---------
// FreeRTOS thread stacks (in 4-byte words)
#define TSK_STACK_MAIN 160
#define TSK_STACK_MSG 200
#define TSK_STACK_JOBRUNNER 128
// Size of the snprintf buffer for debug messages
// (this is on stack to avoid races)
#define DBG_BUF_LEN 80
// Bulk read/write
#define BULK_LST_TIMEOUT_MS 200 // timeout for the bulk transaction to expire
#define BULKREAD_MAX_CHUNK 512 // this is a static buffer
// Error message buffer size (on stack)
#define ERR_MSG_STR_LEN 32
// Static buffer for saving to flash
#define FLASH_SAVE_BUF_LEN 256
// Number of job runner slots
#define HP_SCHED_CAPACITY 5
// Number of message queue slots (64 bytes each)
#define RX_QUE_CAPACITY 10
// ------ TinyFrame config ------
// Maximum received payload size (static buffer)
// Larger payloads will be rejected.
#define TF_MAX_PAYLOAD_RX 640
// Size of the sending buffer. Larger payloads will be split to pieces and sent
// in multiple calls to the write function. This can be lowered to reduce RAM usage.
#define TF_SENDBUF_LEN 64
// --- Listener counts - determine sizes of the static slot tables ---
// Frame ID listeners (wait for response / multi-part message)
#define TF_MAX_ID_LST 4
// Frame Type listeners (wait for frame with a specific first payload byte)
#define TF_MAX_TYPE_LST 6
// Generic listeners (fallback if no other listener catches it)
#define TF_MAX_GEN_LST 1
// Timeout for receiving & parsing a frame
// ticks = number of calls to TF_Tick()
#define TF_PARSER_TIMEOUT_TICKS 250
// --- Mass Storage / USB config ---
#define USBD_MAX_STR_DESC_SIZ 128
#define MSC_MEDIA_PACKET 512
// INI buffer sizes
#define INI_KEY_MAX 20
#define INI_VALUE_MAX 30
// ini writer
#define IWBUFFER_LEN 128
// -------- Platform specific includes and defines ---------
#if defined(GEX_PLAT_F103_BLUEPILL)
// platform name for the version string