Added deviceid command. Use saveconfig to store

pull/4/head
erikkaashoek 6 years ago
parent 78776a95b0
commit eb85400e0e

@ -95,7 +95,7 @@ config_save(void)
/* erase flash pages */
flash_erase_page((uint32_t)dst);
/* write to flahs */
/* write to flash */
while (count-- > 0) {
flash_program_half_word((uint32_t)dst, *src++);
dst++;

@ -2344,6 +2344,7 @@ static const VNAShellCommand commands[] =
{ "spur", cmd_spur, 0 },
{ "load", cmd_load, 0 },
{ "output", cmd_output, 0 },
{ "deviceid", cmd_deviceid, 0 },
{ "selftest", cmd_selftest, 0 },
{ "correction", cmd_correction, 0 },
#ifdef ENABLE_THREADS_COMMAND

@ -428,6 +428,7 @@ typedef struct config {
int16_t high_level_offset;
uint32_t correction_frequency[CORRECTION_POINTS];
float correction_value[CORRECTION_POINTS];
uint32_t deviceid;
// uint8_t _reserved[22];
uint32_t checksum;
} config_t;

@ -192,6 +192,19 @@ VNA_SHELL_FUNCTION(cmd_leveloffset)
}
}
VNA_SHELL_FUNCTION(cmd_deviceid)
{
if (argc == 0) {
shell_printf("deviceid %d\r\n", config.deviceid);
return;
} else if (argc == 1) {
float v = my_atoui(argv[0]);
config.deviceid = v;
} else {
shell_printf("deviceid [<number>]\r\n");
}
}
VNA_SHELL_FUNCTION(cmd_rbw)
{

Loading…
Cancel
Save

Powered by TurnKey Linux.