Add preliminary safety ADC which measures the Controller temperature and checks the reference voltage against the STM's internal reference voltage

This commit is contained in:
2020-05-16 21:00:55 +02:00
parent dc8beefb63
commit e97092042b
6 changed files with 290 additions and 6 deletions

View File

@@ -35,6 +35,7 @@
#include <fatfs/ff.h>
#include <reflow-controller/stack-check.h>
#include <reflow-controller/rotary-encoder.h>
#include <reflow-controller/safety-adc.h>
#ifndef GIT_VER
#define GIT_VER "VERSION NOT SET"
@@ -342,6 +343,18 @@ static shellmatta_retCode_t shell_cmd_cat(const shellmatta_handle_t handle, cons
return SHELLMATTA_OK;
}
static shellmatta_retCode_t shell_cmd_safety_adc(const shellmatta_handle_t handle, const char *arguments,
uint32_t length)
{
(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());
return SHELLMATTA_OK;
}
//typedef struct shellmatta_cmd
//{
// char *cmd; /**< command name */
@@ -352,7 +365,7 @@ static shellmatta_retCode_t shell_cmd_cat(const shellmatta_handle_t handle, cons
// struct shellmatta_cmd *next; /**< pointer to next command or NULL */
//} shellmatta_cmd_t;
static shellmatta_cmd_t cmd[13] = {
static shellmatta_cmd_t cmd[14] = {
{
.cmd = "version",
.cmdAlias = "ver",
@@ -455,8 +468,16 @@ static shellmatta_cmd_t cmd[13] = {
.helpText = "Print file contents",
.usageText = "cat <path>",
.cmdFct = shell_cmd_cat,
.next = &cmd[13],
},
{
.cmd = "safety-adc",
.cmdAlias = NULL,
.helpText = "",
.usageText = "",
.cmdFct = shell_cmd_safety_adc,
.next = NULL,
}
},
};