From 9bb6d34ef404661193eb1b22590fd14da22dea98 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Sat, 22 Jan 2022 22:34:03 +0100 Subject: [PATCH] Added board command to host protocol --- Config.h | 8 ++++---- Framing.h | 1 + RNode_Firmware.ino | 2 ++ Utilities.h | 7 +++++++ 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Config.h b/Config.h index 85ef7e5..02e9049 100644 --- a/Config.h +++ b/Config.h @@ -4,7 +4,7 @@ #define CONFIG_H #define MAJ_VERS 0x01 - #define MIN_VERS 0x19 + #define MIN_VERS 0x20 #define PLATFORM_AVR 0x90 #define PLATFORM_ESP32 0x80 @@ -133,9 +133,9 @@ #endif #if BOARD_MODEL == BOARD_TBEAM - #define I2C_SDA 21 - #define I2C_SCL 22 - #define PMU_IRQ 35 + #define I2C_SDA 21 + #define I2C_SCL 22 + #define PMU_IRQ 35 #endif #define eeprom_addr(a) (a+EEPROM_OFFSET) diff --git a/Framing.h b/Framing.h index 756993d..cc5d591 100644 --- a/Framing.h +++ b/Framing.h @@ -27,6 +27,7 @@ #define CMD_BLINK 0x30 #define CMD_RANDOM 0x40 + #define CMD_BOARD 0x47 #define CMD_PLATFORM 0x48 #define CMD_MCU 0x49 #define CMD_FW_VERSION 0x50 diff --git a/RNode_Firmware.ino b/RNode_Firmware.ino index 465f4e1..ea1c90c 100644 --- a/RNode_Firmware.ino +++ b/RNode_Firmware.ino @@ -615,6 +615,8 @@ void serialCallback(uint8_t sbyte) { kiss_indicate_platform(); } else if (command == CMD_MCU) { kiss_indicate_mcu(); + } else if (command == CMD_BOARD) { + kiss_indicate_board(); } else if (command == CMD_CONF_SAVE) { eeprom_conf_save(); } else if (command == CMD_CONF_DELETE) { diff --git a/Utilities.h b/Utilities.h index 7a5c9c1..5ebcc3d 100644 --- a/Utilities.h +++ b/Utilities.h @@ -429,6 +429,13 @@ void kiss_indicate_platform() { Serial.write(FEND); } +void kiss_indicate_board() { + Serial.write(FEND); + Serial.write(CMD_BOARD); + Serial.write(BOARD_MODEL); + Serial.write(FEND); +} + void kiss_indicate_mcu() { Serial.write(FEND); Serial.write(CMD_MCU);