Commit 980e0a59 authored by Tomasz Wlostowski's avatar Tomasz Wlostowski

shell: calibration command now allows to read/set all calibration parameters

parent 2d66b272
......@@ -24,10 +24,32 @@ static int cmd_calibration(const char *args[])
{
uint32_t trans;
if (args[0] && !strcasecmp(args[0], "force")) {
if (measure_t24p(&trans) < 0)
return -1;
return storage_phtrans(&trans, 1);
if (args[0])
{
if(!strcasecmp(args[0], "force"))
{
if (measure_t24p(&trans) < 0)
return -1;
return storage_phtrans(&trans, 1);
}
else if (!strcasecmp( args[0], "load" ) )
{
storage_load_calibration();
}
else if (!strcasecmp( args[0], "setp" ) )
{
uint32_t param = 0;
param |= ((uint32_t)(args[1][0])) << 24;
param |= ((uint32_t)(args[1][1])) << 16;
param |= ((uint32_t)(args[1][2])) << 8;
param |= ((uint32_t)(args[1][3])) << 0;
int value = atoi(args[2]);
pp_printf("Setting calibration parameter %s [0x%x] to %d\n", args[1], param ,value );
storage_set_calibration_parameter( param, value );
}
} 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