diff --git a/Boards.h b/Boards.h index 6e7150f..14260a2 100644 --- a/Boards.h +++ b/Boards.h @@ -632,6 +632,7 @@ #elif MCU_VARIANT == MCU_NRF52 #if BOARD_MODEL == BOARD_TECHO #define VALIDATE_FIRMWARE false + #define HAS_INPUT true //#define GPS_BAUD_RATE 115200 //#define PIN_GPS_TX 41 //#define PIN_GPS_RX 40 @@ -691,6 +692,9 @@ const int pin_disp_mosi = 29; const int pin_disp_miso = -1; + #define HAS_BACKLIGHT true + const int pin_btn_usr1 = 42; + const int pin_backlight = 43; const int pin_led_rx = LED_BLUE; const int pin_led_tx = LED_RED; diff --git a/Display.h b/Display.h index 9245d49..e88fbb2 100644 --- a/Display.h +++ b/Display.h @@ -94,7 +94,7 @@ void busyCallback(const void* p) { // todo: add support for OLED board #elif DISPLAY == EINK_BW SPIClass displaySPI = SPIClass(NRF_SPIM0, pin_disp_miso, pin_disp_sck, pin_disp_mosi); - #define DISP_W 250 + #define DISP_W 200 #define DISP_H 122 #define DISP_ADDR -1 #endif @@ -170,9 +170,10 @@ uint8_t online_interfaces = 0; #if DISPLAY == OLED #define WATERFALL_SIZE 46 -#elif (DISP_H == 122 || DISP_H == 200) && (DISPLAY == EINK_BW || DISPLAY == EINK_3C) +#elif DISP_H == 122 && (DISPLAY == EINK_BW || DISPLAY == EINK_3C) #define WATERFALL_SIZE 92 #else +#define WATERFALL_SIZE int(DISP_H * 0.75) // default to 75% of the display height // add more eink compatible boards here #endif @@ -190,6 +191,9 @@ GFXcanvas1 disp_area(64, 64); #elif (DISP_H == 122 || DISP_H == 200) && (DISPLAY == EINK_BW || DISPLAY == EINK_3C) GFXcanvas1 stat_area(DISP_H, DISP_W/2); GFXcanvas1 disp_area(DISP_H, DISP_W/2); +#else +GFXcanvas1 stat_area(DISP_H, DISP_W/2); +GFXcanvas1 disp_area(DISP_H, DISP_W/2); #endif void update_area_positions() { @@ -361,8 +365,10 @@ void draw_cable_icon(int px, int py) { if (cable_state == CABLE_STATE_DISCONNECTED) { #if DISPLAY == OLED stat_area.drawBitmap(px, py, bm_cable+0*32, 16, 16, SSD1306_WHITE, SSD1306_BLACK); - #elif (DISP_H == 122 || DISP_H == 200) && (DISPLAY == EINK_BW || DISPLAY == EINK_3C) + #elif DISP_H == 122 && (DISPLAY == EINK_BW || DISPLAY == EINK_3C) stat_area.drawBitmap(px, py, bm_cable+0*128, 30, 32, GxEPD_WHITE, GxEPD_BLACK); + #else + stat_area.drawBitmap(px, py, bm_cable+0*128, 16, 16, GxEPD_WHITE, GxEPD_BLACK); #endif } else if (cable_state == CABLE_STATE_CONNECTED) { #if DISPLAY == OLED @@ -1147,7 +1153,7 @@ void update_display(bool blank = false) { } display.clearDisplay(); update_stat_area(); - update_disp_area(); + //update_disp_area(); display.display(); uint32_t current = millis(); diff --git a/Graphics.h b/Graphics.h index 47f19bf..668af71 100644 --- a/Graphics.h +++ b/Graphics.h @@ -13,7 +13,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -#if DISP_H == UNSCALED_MAX +#if DISP_H == UNSCALED_MAX || DISP_H == 200 // use 64px wide graphics const unsigned char bm_cable [] PROGMEM = { @@ -408,7 +408,7 @@ const unsigned char bm_dot_sqr [] PROGMEM = { 0x80, 0x00, 0x40, 0x00, 0x00, 0x00, 0xaa, 0xd5, 0x40 }; -#elif (DISP_H == 122 || DISP_H == 200) +#elif DISP_H == 122 // use 122px wide graphics const unsigned char bm_bt [] PROGMEM = { diff --git a/RNode_Firmware_CE.ino b/RNode_Firmware_CE.ino index a82e70e..b0da1a9 100644 --- a/RNode_Firmware_CE.ino +++ b/RNode_Firmware_CE.ino @@ -1297,6 +1297,11 @@ void loop() { #if HAS_INPUT input_read(); + #if HAS_BACKLIGHT + if (button_pressed()) { + digitalWrite(pin_backlight, !digitalRead(pin_backlight)); + } + #endif #endif } diff --git a/Utilities.h b/Utilities.h index 0424984..45ba1ed 100644 --- a/Utilities.h +++ b/Utilities.h @@ -1537,4 +1537,4 @@ void unlock_rom() { eeprom_erase(); } -#include "src/misc/FIFOBuffer.h" +#include "src/misc/FIFOBuffer.h" \ No newline at end of file