diff --git a/Framing.h b/Framing.h index efa4b31..c124ffb7 100644 --- a/Framing.h +++ b/Framing.h @@ -52,6 +52,7 @@ #define CMD_FB_READ 0x42 #define CMD_FB_WRITE 0x43 #define CMD_FB_READL 0x44 + #define CMD_DISP_READ 0x66 #define CMD_DISP_INT 0x45 #define CMD_DISP_ADDR 0x63 #define CMD_DISP_BLNK 0x64 diff --git a/RNode_Firmware.ino b/RNode_Firmware.ino index 57a7f2f..d1e9237 100644 --- a/RNode_Firmware.ino +++ b/RNode_Firmware.ino @@ -973,9 +973,9 @@ void serialCallback(uint8_t sbyte) { } #endif } else if (command == CMD_FB_READ) { - if (sbyte != 0x00) { - kiss_indicate_fb(); - } + if (sbyte != 0x00) { kiss_indicate_fb(); } + } else if (command == CMD_DISP_READ) { + if (sbyte != 0x00) { kiss_indicate_disp(); } } else if (command == CMD_DEV_HASH) { #if MCU_VARIANT == MCU_ESP32 || MCU_VARIANT == MCU_NRF52 if (sbyte != 0x00) { diff --git a/Utilities.h b/Utilities.h index d532220..a2b1d6c 100644 --- a/Utilities.h +++ b/Utilities.h @@ -977,6 +977,20 @@ void kiss_indicate_fb() { serial_write(FEND); } +void kiss_indicate_disp() { + serial_write(FEND); + serial_write(CMD_DISP_READ); + #if HAS_DISPLAY + uint8_t *da = disp_area.getBuffer(); + uint8_t *sa = stat_area.getBuffer(); + for (int i = 0; i < 512; i++) { escaped_serial_write(da[i]); } + for (int i = 0; i < 512; i++) { escaped_serial_write(sa[i]); } + #else + serial_write(0xFF); + #endif + serial_write(FEND); +} + void kiss_indicate_ready() { serial_write(FEND); serial_write(CMD_READY);