Further rewrite safety handling
This commit is contained in:
@@ -358,22 +358,10 @@ static shellmatta_retCode_t shell_cmd_safety_adc(const shellmatta_handle_t handl
|
||||
(void)length;
|
||||
(void)arguments;
|
||||
|
||||
shellmatta_printf(handle, "VREF:\t%8.2f\tmV\r\n", safety_adc_get_vref());
|
||||
shellmatta_printf(handle, "TEMP:\t%8.2f\tdeg. Celsius\r\n", safety_adc_get_temp());
|
||||
shellmatta_printf(handle, "VREF:\t%8.2f\tmV\r\n", 2500.0f);
|
||||
shellmatta_printf(handle, "TEMP:\t%8.2f\tdeg. Celsius\r\n", 25.0f);
|
||||
|
||||
shellmatta_printf(handle, "Errors:\t%X", safety_adc_get_errors());
|
||||
|
||||
return SHELLMATTA_OK;
|
||||
}
|
||||
|
||||
static shellmatta_retCode_t shell_cmd_safety_adc_clear_error(const shellmatta_handle_t handle, const char *arguments,
|
||||
uint32_t length)
|
||||
{
|
||||
(void)length;
|
||||
(void)arguments;
|
||||
(void)handle;
|
||||
|
||||
safety_adc_clear_errors();
|
||||
shellmatta_printf(handle, "Errors:\t%X", 0);
|
||||
|
||||
return SHELLMATTA_OK;
|
||||
}
|
||||
@@ -388,7 +376,7 @@ static shellmatta_retCode_t shell_cmd_safety_adc_clear_error(const shellmatta_ha
|
||||
// struct shellmatta_cmd *next; /**< pointer to next command or NULL */
|
||||
//} shellmatta_cmd_t;
|
||||
|
||||
static shellmatta_cmd_t cmd[15] = {
|
||||
static shellmatta_cmd_t cmd[14] = {
|
||||
{
|
||||
.cmd = "version",
|
||||
.cmdAlias = "ver",
|
||||
@@ -499,17 +487,8 @@ static shellmatta_cmd_t cmd[15] = {
|
||||
.helpText = "",
|
||||
.usageText = "",
|
||||
.cmdFct = shell_cmd_safety_adc,
|
||||
.next = &cmd[14],
|
||||
},
|
||||
{
|
||||
.cmd = "safety-adc-clear-error",
|
||||
.cmdAlias = NULL,
|
||||
.helpText = "",
|
||||
.usageText = "",
|
||||
.cmdFct = shell_cmd_safety_adc_clear_error,
|
||||
.next = NULL,
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
shellmatta_handle_t shell_init(shellmatta_write_t write_func)
|
||||
|
Reference in New Issue
Block a user