From ba8c640d6ee30120e121b53fce806f93e25ade13 Mon Sep 17 00:00:00 2001 From: geeksville Date: Sat, 26 Sep 2020 10:53:02 -0700 Subject: [PATCH] eink leds kinda work now --- src/configuration.h | 2 ++ variants/eink/variant.h | 18 ++++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/configuration.h b/src/configuration.h index 55464d6cd..df8b2fb80 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -143,7 +143,9 @@ along with this program. If not, see . #define FLIP_SCREEN_VERTICALLY // DEBUG LED +#ifndef LED_INVERTED #define LED_INVERTED 0 // define as 1 if LED is active low (on) +#endif // ----------------------------------------------------------------------------- // GPS diff --git a/variants/eink/variant.h b/variants/eink/variant.h index 3fc61f4ff..1017a09d7 100644 --- a/variants/eink/variant.h +++ b/variants/eink/variant.h @@ -27,7 +27,7 @@ /* @geeksville eink TODO: -button not working +fix regout0! get pps blinking on second board clean up eink drawing to not have the nasty timeout hack put eink to sleep when we think the screen is off @@ -35,6 +35,7 @@ enable flash on spi0, share chip selects on spi1. https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52832.ps.v1.1%2Fspi.html enable reset as a button in bootloader fix battery pin usage drive TCXO DIO3 enable high whenever we want the clock use PIN_GPS_WAKE to sleep the GPS use tp_ser_io as a button, it goes high when pressed unify eink display classes +make screen.adjustBrightness() a nop on eink screens eink probably is // #include // 1.54" b/w //G702-A https://github.com/Xinyuan-LilyGO/LilyGO_T5_V24 @@ -69,9 +70,9 @@ extern "C" { #define NUM_ANALOG_OUTPUTS (0) // LEDs -#define PIN_LED1 (0 + 13) // green -#define PIN_LED2 (0 + 14) // red -#define PIN_LED3 (0 + 15) // blue +#define PIN_LED1 (0 + 13) // green (but red on my prototype) +#define PIN_LED2 (0 + 15) // blue (but red on my prototype) +#define PIN_LED3 (0 + 14) // red (not functional on my prototype) #define LED_RED PIN_LED2 #define LED_GREEN PIN_LED1 @@ -81,6 +82,7 @@ extern "C" { #define LED_CONN PIN_BLUE #define LED_STATE_ON 0 // State when LED is lit +#define LED_INVERTED 1 /* * Buttons @@ -195,11 +197,11 @@ FIXME define/FIX flash access #define PIN_GPS_WAKE (32 + 2) #define PIN_GPS_PPS (32 + 4) -#define PIN_GPS_TX (32 + 8) // This is for bits going TOWARDS the GPS -#define PIN_GPS_RX (32 + 9) // This is for bits going TOWARDS the CPU +#define PIN_GPS_TX (32 + 9) // This is for bits going TOWARDS the CPU +#define PIN_GPS_RX (32 + 8) // This is for bits going TOWARDS the GPS -#define PIN_SERIAL1_RX PIN_GPS_RX -#define PIN_SERIAL1_TX PIN_GPS_TX +#define PIN_SERIAL1_RX PIN_GPS_TX +#define PIN_SERIAL1_TX PIN_GPS_RX /* * SPI Interfaces