Added display read command

This commit is contained in:
Mark Qvist 2024-12-08 13:49:07 +01:00
parent 9edc2224e7
commit 4b48f41c38
3 changed files with 18 additions and 3 deletions

View File

@ -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

View File

@ -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) {

View File

@ -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);