Add reset-cal shell command and modify cal command to show existing calibration

This commit is contained in:
2020-11-17 00:53:21 +01:00
parent d176389711
commit 37bc397e9a
2 changed files with 27 additions and 3 deletions

View File

@@ -648,6 +648,17 @@ static shellmatta_retCode_t shell_cmd_dump_safety_mem(const shellmatta_handle_t
return SHELLMATTA_BUSY;
}
shellmatta_retCode_t shell_cmd_reset_cal(const shellmatta_handle_t handle, const char *arguments, uint32_t length)
{
(void)handle;
(void)arguments;
(void)length;
adc_pt1000_set_resistance_calibration(0.0f, 0.0f, false);
return SHELLMATTA_OK;
}
//typedef struct shellmatta_cmd
//{
// char *cmd; /**< command name */
@@ -657,7 +668,7 @@ static shellmatta_retCode_t shell_cmd_dump_safety_mem(const shellmatta_handle_t
// shellmatta_cmdFct_t cmdFct; /**< pointer to the cmd callack function */
// struct shellmatta_cmd *next; /**< pointer to next command or NULL */
//} shellmatta_cmd_t;
static shellmatta_cmd_t cmd[18] = {
static shellmatta_cmd_t cmd[19] = {
{
.cmd = "version",
.cmdAlias = "ver",
@@ -800,8 +811,16 @@ static shellmatta_cmd_t cmd[18] = {
.helpText = "",
.usageText = "safety-mem-dump [output-file]",
.cmdFct = shell_cmd_dump_safety_mem,
.next = NULL,
.next = &cmd[18],
},
{
.cmd = "reset-cal",
.cmdAlias = NULL,
.helpText = "Reset Calibration",
.usageText = "",
.cmdFct = shell_cmd_reset_cal,
.next = NULL,
}
};
shellmatta_handle_t shell_init(shellmatta_write_t write_func)