Add PCB/Hardware version detection

This commit is contained in:
2020-11-29 19:02:30 +01:00
parent 32da2a5fa6
commit f4d6f5a1ae
3 changed files with 67 additions and 2 deletions

View File

@@ -40,6 +40,7 @@
#include <reflow-controller/button.h>
#include <reflow-controller/safety/fault.h>
#include <reflow-controller/safety/safety-memory.h>
#include <reflow-controller/hw-version-detect.h>
#ifndef GIT_VER
#define GIT_VER "VERSION NOT SET"
@@ -81,12 +82,28 @@ static shellmatta_retCode_t shell_cmd_ver(const shellmatta_handle_t handle,
uint32_t low_id;
uint32_t mid_id;
uint32_t high_id;
const char *hw_rev_str;
enum hw_revision pcb_rev;
unique_id_get(&high_id, &mid_id, &low_id);
shellmatta_printf(handle, "Reflow Oven Controller Firmware " xstr(GIT_VER) "\r\n"
"Compiled: " __DATE__ " at " __TIME__ "\r\n");
shellmatta_printf(handle, "Serial: %08X-%08X-%08X", high_id, mid_id, low_id);
shellmatta_printf(handle, "Serial: %08X-%08X-%08X\r\n", high_id, mid_id, low_id);
pcb_rev = get_pcb_hardware_version();
switch (pcb_rev) {
case HW_REV_V1_2:
hw_rev_str = "Hardware: v1.2";
break;
case HW_REV_V1_3:
hw_rev_str = "Hardware: v1.3";
break;
default:
hw_rev_str = "Hardware: Unknown Revision. You might have to update the firmware!";
break;
}
shellmatta_printf(handle, "%s", hw_rev_str);
return SHELLMATTA_OK;
}