Commit dc68323e authored by Tristan Gingold's avatar Tristan Gingold

Add optional command calibration show

parent c948de4d
......@@ -310,6 +310,14 @@ config GENSDBFS
This option adds _sdb fs_ command to write empty SDBFS filesystem
image in Flash/EEPROM.
config CMD_CALIBRATION_SHOW
depends on WR_NODE
boolean "Add command to print all calibration values"
default n
help
Adds an "show" to the calibration command to print all
calibration values.
config VLAN
depends on WR_NODE
boolean "Filter and rx/tx frames in a VLAN (as opposed to untagged)"
......
......@@ -50,7 +50,28 @@ static int cmd_calibration(const char *args[])
args[1], (unsigned int) param, value);
storage_set_calibration_parameter( param, value );
}
#ifdef CONFIG_CMD_CALIBRATION_SHOW
else if (!strcmp(args[0], "show")) {
wrc_cal_data_t *cal;
unsigned i;
if (!storage_is_calibration_loaded()) {
pp_printf("calibrations not loaded\n");
return 0;
}
cal = storage_get_calibration_data();
pp_printf("%u params:\n", (unsigned)cal->param_count);
for(i = 0; i < cal->param_count; i++) {
unsigned id = cal->params[i].id;
pp_printf( " %c%c%c%c = %u\n",
(id >> 24) & 0xff,
(id >> 16) & 0xff,
(id >> 8) & 0xff,
(id >> 0) & 0xff,
(unsigned)cal->params[i].value);
}
}
#endif
} else if (!args[0]) {
if (storage_phtrans(&trans, 0) > 0) {
pp_printf("Found phase transition in EEPROM: %dps\n",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment