This commit is contained in:
cpq committed 2026-05-01 14:06:01 +01:00
1 parent 57a41f5824
commit 3cd0e25333
1 file changed
+10 -2
+10 -2
View File
@@ -8,13 +8,21 @@ static char s_version[10];
static void read_status(void) { static void read_status(void) {
MG_INFO(("READING STATUS")); MG_INFO(("READING STATUS"));
// s_led1 = gpio_read(LED1_PIN);
mg_snprintf(s_version, sizeof(s_version), "1.2.3"); mg_snprintf(s_version, sizeof(s_version), "1.2.3");
// These conditionals make this file work on both microcontroller and desktop
// Useful for developing the UI on desktop, and copying to an MCU project.
#if MG_ARCH == MG_ARCH_CUBE
s_led1 = HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_0); // Read LED state into field
#endif
} }
static void write_status(void) { static void write_status(void) {
MG_INFO(("WRITING STATUS")); MG_INFO(("WRITING STATUS"));
// gpio_write(LED1_PIN, s_led1);
#if MG_ARCH == MG_ARCH_CUBE
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_0, s_led1); // Write LED state from field
#endif
} }
static struct mg_field fields_status[] = { static struct mg_field fields_status[] = {