rcommand code sanitization
This commit is contained in:
parent
1d2c79133f
commit
ac2f67e98f
@ -19,7 +19,7 @@
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
const uint8_t opcode;
|
const uint8_t opcode;
|
||||||
void (*func)(uint8_t []);
|
void (*func)(uint8_t []);
|
||||||
uint8_t params;
|
const uint8_t params;
|
||||||
const bool store;
|
const bool store;
|
||||||
} cmd_t;
|
} cmd_t;
|
||||||
|
|
||||||
|
@ -332,7 +332,7 @@ void set_flush(uint8_t val[]) {
|
|||||||
// format: opcode, function, #bytes params,
|
// format: opcode, function, #bytes params,
|
||||||
// flag (true = do make settings persistent / false = don't)
|
// flag (true = do make settings persistent / false = don't)
|
||||||
//
|
//
|
||||||
cmd_t table[] = {
|
static cmd_t table[] = {
|
||||||
{0x01, set_rssi, 1, true}, {0x02, set_countmode, 1, true},
|
{0x01, set_rssi, 1, true}, {0x02, set_countmode, 1, true},
|
||||||
{0x03, set_gps, 1, true}, {0x04, set_display, 1, true},
|
{0x03, set_gps, 1, true}, {0x04, set_display, 1, true},
|
||||||
{0x05, set_lorasf, 1, true}, {0x06, set_lorapower, 1, true},
|
{0x05, set_lorasf, 1, true}, {0x06, set_lorapower, 1, true},
|
||||||
@ -349,7 +349,7 @@ cmd_t table[] = {
|
|||||||
{0x85, get_bme, 0, false}, {0x86, get_time, 0, false},
|
{0x85, get_bme, 0, false}, {0x86, get_time, 0, false},
|
||||||
{0x87, set_time, 0, false}, {0x99, set_flush, 0, false}};
|
{0x87, set_time, 0, false}, {0x99, set_flush, 0, false}};
|
||||||
|
|
||||||
const uint8_t cmdtablesize =
|
static const uint8_t cmdtablesize =
|
||||||
sizeof(table) / sizeof(table[0]); // number of commands in command table
|
sizeof(table) / sizeof(table[0]); // number of commands in command table
|
||||||
|
|
||||||
// check and execute remote command
|
// check and execute remote command
|
||||||
|
Loading…
Reference in New Issue
Block a user