Fix display on NRF52

This commit is contained in:
jacob.eva 2024-05-05 17:15:55 +01:00
parent 50da242f79
commit 29e8406437
No known key found for this signature in database
GPG Key ID: 0B92E083BBCCAA1E
3 changed files with 17 additions and 1 deletions

View File

@ -134,7 +134,11 @@ bool display_init() {
#endif #endif
#if DISP_CUSTOM_ADDR == true #if DISP_CUSTOM_ADDR == true
#if HAS_EEPROM
uint8_t display_address = EEPROM.read(eeprom_addr(ADDR_CONF_DADR)); uint8_t display_address = EEPROM.read(eeprom_addr(ADDR_CONF_DADR));
#elif MCU_VARIANT == MCU_NRF52
uint8_t display_address = eeprom_read(eeprom_addr(ADDR_CONF_DADR));
#endif
if (display_address == 0xFF) display_address = DISP_ADDR; if (display_address == 0xFF) display_address = DISP_ADDR;
#else #else
uint8_t display_address = DISP_ADDR; uint8_t display_address = DISP_ADDR;
@ -188,7 +192,11 @@ bool display_init() {
disp_area.cp437(true); disp_area.cp437(true);
display.cp437(true); display.cp437(true);
display_intensity = EEPROM.read(eeprom_addr(ADDR_CONF_DINT)); #if HAS_EEPROM
uint8_t display_intensity = EEPROM.read(eeprom_addr(ADDR_CONF_DINT));
#elif MCU_VARIANT == MCU_NRF52
uint8_t display_intensity = eeprom_read(eeprom_addr(ADDR_CONF_DINT));
#endif
return true; return true;
} }

View File

@ -151,7 +151,11 @@ void setup() {
#endif #endif
#if HAS_DISPLAY #if HAS_DISPLAY
#if HAS_EEPROM
if (EEPROM.read(eeprom_addr(ADDR_CONF_DSET)) != CONF_OK_BYTE) { if (EEPROM.read(eeprom_addr(ADDR_CONF_DSET)) != CONF_OK_BYTE) {
#elif MCU_VARIANT == MCU_NRF52
if (eeprom_read(eeprom_addr(ADDR_CONF_DSET)) != CONF_OK_BYTE) {
#endif
eeprom_update(eeprom_addr(ADDR_CONF_DSET), CONF_OK_BYTE); eeprom_update(eeprom_addr(ADDR_CONF_DSET), CONF_OK_BYTE);
eeprom_update(eeprom_addr(ADDR_CONF_DINT), 0xFF); eeprom_update(eeprom_addr(ADDR_CONF_DINT), 0xFF);
} }

View File

@ -43,6 +43,10 @@ sx128x *LoRa = &sx128x_modem;
#include "Framing.h" #include "Framing.h"
#include "MD5.h" #include "MD5.h"
#if !HAS_EEPROM && MCU_VARIANT == MCU_NRF52
uint8_t eeprom_read(uint32_t mapped_addr);
#endif
#if HAS_DISPLAY == true #if HAS_DISPLAY == true
#include "Display.h" #include "Display.h"
#endif #endif