From c602fdde7cb0c910ce91b8156e59b741475f9b8a Mon Sep 17 00:00:00 2001 From: phdlee Date: Fri, 15 Jun 2018 20:48:51 +0900 Subject: [PATCH] Add EEProm Read by Nextion LCD Reversed order --- ubitx_20/ubitx_lcd_nextion.ino | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ubitx_20/ubitx_lcd_nextion.ino b/ubitx_20/ubitx_lcd_nextion.ino index 0df8ccd..6f228b7 100644 --- a/ubitx_20/ubitx_lcd_nextion.ino +++ b/ubitx_20/ubitx_lcd_nextion.ino @@ -626,8 +626,9 @@ void updateDisplay() { #define RESPONSE_SPECTRUM 0 #define RESPONSE_EEPROM 1 -#define RESPONSE_EEPROM_HEX 0 -#define RESPONSE_EEPROM_STR 1 +#define RESPONSE_EEPROM_HEX_F 89 //C Language order +#define RESPONSE_EEPROM_HEX_R 72 //Nextion order (Reverse) +#define RESPONSE_EEPROM_STR 87 //String uint8_t ResponseHeader[11]={'p', 'm', '.', 's', 'h', '.', 't', 'x', 't', '=', '"'}; uint8_t ResponseFooter[4]={'"', 0xFF, 0xFF, 0xFF}; @@ -677,7 +678,7 @@ void sendResponseData(int protocolType, unsigned long startFreq, unsigned int se } else { - readedValue = EEPROM.read(k + sendOption1); + readedValue = EEPROM.read(((sendOption2 == RESPONSE_EEPROM_HEX_R) ? (readCount - k - 1) : k) + sendOption1); } if (protocolType == RESPONSE_EEPROM && sendOption2 == RESPONSE_EEPROM_STR) //None HEX