Limit the number of macros to 255
This commit is contained in:
@@ -41,7 +41,7 @@ parser_error_t ParseConfig(config_buffer_t *buffer)
|
||||
if (macroCount > MAX_MACRO_NUM) {
|
||||
return ParserError_InvalidMacroCount;
|
||||
}
|
||||
for (uint16_t macroIdx = 0; macroIdx < macroCount; macroIdx++) {
|
||||
for (uint8_t macroIdx = 0; macroIdx < macroCount; macroIdx++) {
|
||||
errorCode = ParseMacro(buffer, macroIdx);
|
||||
if (errorCode != ParserError_Success) {
|
||||
return errorCode;
|
||||
|
||||
@@ -87,7 +87,7 @@ parser_error_t parseMacroAction(config_buffer_t *buffer) {
|
||||
return ParserError_InvalidSerializedMacroActionType;
|
||||
}
|
||||
|
||||
parser_error_t ParseMacro(config_buffer_t *buffer, uint16_t macroIdx) {
|
||||
parser_error_t ParseMacro(config_buffer_t *buffer, uint8_t macroIdx) {
|
||||
uint16_t offset = buffer->offset;
|
||||
parser_error_t errorCode;
|
||||
uint16_t nameLen;
|
||||
|
||||
@@ -20,6 +20,6 @@
|
||||
|
||||
// Functions:
|
||||
|
||||
parser_error_t ParseMacro(config_buffer_t *buffer, uint16_t macroIdx);
|
||||
parser_error_t ParseMacro(config_buffer_t *buffer, uint8_t macroIdx);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
uint8_t keymapId;
|
||||
} __attribute__ ((packed)) switchKeymap;
|
||||
struct {
|
||||
uint16_t macroId;
|
||||
uint8_t macroId;
|
||||
} __attribute__ ((packed)) playMacro;
|
||||
struct {
|
||||
test_action_t testAction;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
// Macros:
|
||||
|
||||
#define MAX_MACRO_NUM 1024
|
||||
#define MAX_MACRO_NUM 255
|
||||
|
||||
// Typedefs:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user