Rename LED_PIN to LED_POWER, move handling out of main to dedicated module (#9512)

* Rename LED_PIN to LED_POWER, move handling out of main to dedicated module

* Misc

* Remove errant endif
This commit is contained in:
Jonathan Bennett
2026-02-05 05:41:00 -06:00
committed by GitHub
co-authored by GitHub
parent 94b7149958
commit 2361776992
107 changed files with 207 additions and 311 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
// EByte EoRA-Hub
// Uses E80 (LR1121) LoRa module
#define LED_PIN 35
#define LED_POWER 35
// Button - user interface
#define BUTTON_PIN 0 // BOOT button
+1 -1
View File
@@ -1,5 +1,5 @@
// LED - status indication
#define LED_PIN 37
#define LED_POWER 37
// Button - user interface
#define BUTTON_PIN 0 // This is the BOOT button, and it has its own pull-up resistor
+1 -1
View File
@@ -100,7 +100,7 @@
*/
// Status
#define LED_PIN 1
#define LED_POWER 1
#define LED_STATE_ON 1 // State when LED is lit
// External notification
// FIXME: Check if EXT_NOTIFY_OUT actualy has any effect and removes the need for setting the external notication pin in the
@@ -1,5 +1,5 @@
// Status
#define LED_PIN 1
#define LED_POWER 1
#define PIN_BUTTON1 47 // 功能键
#define PIN_BUTTON2 4 // 电源键
@@ -8,5 +8,11 @@ void earlyInitVariant()
Wire.begin(48, 47);
io.pinMode(PCA_PIN_EINK_EN, OUTPUT);
io.pinMode(PCA_PIN_POWER_EN, OUTPUT);
io.pinMode(PCA_LED_POWER, OUTPUT);
io.pinMode(PCA_LED_USER, OUTPUT);
io.pinMode(PCA_LED_ENABLE, OUTPUT);
io.digitalWrite(PCA_PIN_POWER_EN, HIGH);
io.digitalWrite(PCA_LED_USER, LOW);
io.digitalWrite(PCA_LED_ENABLE, LOW);
}
@@ -8,8 +8,10 @@
// LED
// Both of these are on the GPIO expander
#define PCA_LED_USER 1 // the Blue LED
#define PCA_LED_POWER 3 // the Red LED? Seems to have hardware logic to blink when USB is plugged in.
#define PCA_LED_USER 1 // the Blue LED
#define PCA_LED_ENABLE 2 // the power supply to the LEDs, in an OR arrangement with VBUS power
#define PCA_LED_POWER 3 // the Red LED? Seems to have hardware logic to blink when USB is plugged in.
#define POWER_LED_HARDWARE_BLINKS_WHILE_CHARGING
// USB_CHECK
#define EXT_PWR_DETECT 12
@@ -11,7 +11,7 @@
#define I2C_SDA 12
#define I2C_SCL 14
#define LED_PIN 46
#define LED_POWER 46
#define LED_STATE_ON 0 // State when LED is litted
// #define BUTTON_PIN 15 // Pico OLED 1.3 User key 0 - removed User key 1 (17)
@@ -26,7 +26,7 @@
// #define GPS_RX_PIN 44
// #define GPS_TX_PIN 43
#define LED_PIN 41
#define LED_POWER 41
#define BUTTON_PIN 2
#define BUTTON_NEED_PULLUP
@@ -11,7 +11,7 @@
#define I2C_SDA 18 // 1 // I2C pins for this board
#define I2C_SCL 17 // 2
// #define LED_PIN 38 // This is a RGB LED not a standard LED
// #define LED_POWER 38 // This is a RGB LED not a standard LED
#define HAS_NEOPIXEL // Enable the use of neopixels
#define NEOPIXEL_COUNT 1 // How many neopixels are connected
#define NEOPIXEL_DATA 38 // gpio pin used to send data to the neopixels
@@ -11,7 +11,7 @@
#define I2C_SDA 18 // 1 // I2C pins for this board
#define I2C_SCL 17 // 2
// #define LED_PIN 38 // This is a RGB LED not a standard LED
// #define LED_POWER 38 // This is a RGB LED not a standard LED
#define HAS_NEOPIXEL // Enable the use of neopixels
#define NEOPIXEL_COUNT 1 // How many neopixels are connected
#define NEOPIXEL_DATA 38 // gpio pin used to send data to the neopixels
+1 -1
View File
@@ -6,7 +6,7 @@
#define I2C_SDA1 45
#define I2C_SCL1 46
#define LED_PIN 6
#define LED_POWER 6
#define LED_STATE_ON 1
#define BUTTON_PIN 0
@@ -1,5 +1,5 @@
#define LED_PIN 33
#define LED_PIN2 34
#define LED_POWER 33
#define LED_POWER2 34
#define EXT_PWR_DETECT 35
#define BUTTON_PIN 18
+1 -1
View File
@@ -1,4 +1,4 @@
#define LED_PIN LED
#define LED_POWER LED
#define USE_SSD1306 // Heltec_v3 has a SSD1306 display
+1 -1
View File
@@ -26,7 +26,7 @@ build_flags =
${heltec_v4_base.build_flags}
-D HELTEC_V4_OLED
-D USE_SSD1306 ; Heltec_v4 has an SSD1315 display (compatible with SSD1306 driver)
-D LED_PIN=35
-D LED_POWER=35
-D RESET_OLED=21
-D I2C_SDA=17
-D I2C_SCL=18
@@ -1,4 +1,4 @@
#define LED_PIN 45 // LED is not populated on earliest board variant
#define LED_POWER 45 // LED is not populated on earliest board variant
#define BUTTON_PIN 0
#define PIN_BUTTON2 21 // Second built-in button
#define ALT_BUTTON_PIN PIN_BUTTON2 // Send the up event
@@ -1,4 +1,4 @@
#define LED_PIN 45 // LED is not populated on earliest board variant
#define LED_POWER 45 // LED is not populated on earliest board variant
#define BUTTON_PIN 0
#define PIN_BUTTON2 21 // Second built-in button
#define ALT_BUTTON_PIN PIN_BUTTON2 // Send the up event
@@ -1,4 +1,4 @@
#define LED_PIN 18
#define LED_POWER 18
#define BUTTON_PIN 0
// I2C
@@ -1,4 +1,4 @@
#define LED_PIN 18
#define LED_POWER 18
#define BUTTON_PIN 0
// I2C
@@ -1,4 +1,4 @@
#define LED_PIN 18
#define LED_POWER 18
#define _VARIANT_HELTEC_WIRELESS_TRACKER
#define HELTEC_TRACKER_V1_X
@@ -1,4 +1,4 @@
#define LED_PIN 18
#define LED_POWER 18
#define HELTEC_TRACKER_V1_X
@@ -1,4 +1,4 @@
#define LED_PIN 18
#define LED_POWER 18
#define _VARIANT_HELTEC_WIRELESS_TRACKER
+1 -1
View File
@@ -1,7 +1,7 @@
#define I2C_SCL SCL
#define I2C_SDA SDA
#define LED_PIN LED
#define LED_POWER LED
#define VEXT_ENABLE Vext // active low, powers the oled display and the lora antenna boost
#define VEXT_ON_VALUE LOW
+1 -1
View File
@@ -13,7 +13,7 @@
#define ADC_CHANNEL ADC1_GPIO4_CHANNEL
// LED
#define LED_PIN 21
#define LED_POWER 21
// Button
#define BUTTON_PIN 0
+1 -1
View File
@@ -1,7 +1,7 @@
#define I2C_SDA 11 // I2C pins for this board
#define I2C_SCL 10
#define LED_PIN 1 // If defined we will blink this LED
#define LED_POWER 1 // If defined we will blink this LED
#define BUTTON_PIN 0 // If defined, this will be used for user button presses
#define BUTTON_NEED_PULLUP
+1 -1
View File
@@ -4,7 +4,7 @@
#define USE_SSD1306
#define DISPLAY_FLIP_SCREEN
#define LED_PIN 15 // If defined we will blink this LED
#define LED_POWER 15 // If defined we will blink this LED
#define HAS_NEOPIXEL // Enable the use of neopixels
#define NEOPIXEL_COUNT 3 // How many neopixels are connected
+1 -1
View File
@@ -24,7 +24,7 @@
#define PIN_LED1 LED_GREEN
#define LED_NOTIFICATION LED_BLUE
#define LED_PIN LED_GREEN
#define LED_POWER LED_GREEN
#define ledOff(pin) pinMode(pin, INPUT)
#define LED_STATE_ON 1 // State when LED is litted
@@ -32,7 +32,7 @@
#define PIN_LED1 LED_GREEN
#define LED_NOTIFICATION LED_BLUE
#define LED_PIN LED_GREEN
#define LED_POWER LED_GREEN
#define ledOff(pin) pinMode(pin, INPUT)
#define LED_STATE_ON 1 // State when LED is litted
+1 -1
View File
@@ -30,7 +30,7 @@ Expansion Board Infomation : https://www.seeedstudio.com/Seeeduino-XIAO-Expansio
L76K GPS Module Information : https://www.seeedstudio.com/L76K-GNSS-Module-for-Seeed-Studio-XIAO-p-5864.html
*/
#define LED_PIN 48
#define LED_POWER 48
#define LED_STATE_ON 1 // State when LED is lit
#define BUTTON_PIN 21 // This is the Program Button
+1 -1
View File
@@ -67,7 +67,7 @@
#endif
// LED
#define LED_PIN 18
#define LED_POWER 18
#define LED_STATE_ON 1 // HIGH = ON
// Battery ADC
+1 -1
View File
@@ -12,7 +12,7 @@
#define HAS_SCREEN 1 // Allow for OLED Screens on I2C Header of shield
#define LED_PIN 38 // If defined we will blink this LED
#define LED_POWER 38 // If defined we will blink this LED
#define BUTTON_PIN 0 // If defined, this will be used for user button presses,
#define BUTTON_NEED_PULLUP
+1 -1
View File
@@ -22,7 +22,7 @@
#define GPS_RX_PIN 44
#define GPS_TX_PIN 43
#define LED_PIN 37
#define LED_POWER 37
#define BUTTON_PIN 0
#define BUTTON_NEED_PULLUP
+1 -1
View File
@@ -14,7 +14,7 @@
#define I2C_SDA1 43
#define I2C_SCL1 44
#define LED_PIN 37 // If defined we will blink this LED
#define LED_POWER 37 // If defined we will blink this LED
#define BUTTON_PIN 0 // If defined, this will be used for user button presses,
#define BUTTON_NEED_PULLUP
@@ -1,4 +1,4 @@
#define LED_PIN 18
#define LED_POWER 18
#define HELTEC_TRACKER_V1_X
+1 -1
View File
@@ -1,4 +1,4 @@
#define LED_PIN 18
#define LED_POWER 18
#define HELTEC_TRACKER_V1_X
+1 -1
View File
@@ -1,4 +1,4 @@
#define LED_PIN 18
#define LED_POWER 18
#define HELTEC_TRACKER_V1_X
+1 -1
View File
@@ -54,7 +54,7 @@
#define SD_SPI_FREQUENCY 25000000
#define LED_PIN 13 // the red part of the RGB LED
#define LED_POWER 13 // the red part of the RGB LED
#define LED_STATE_ON 0 // State when LED is lit
#define ALT_BUTTON_PIN 21 // Button 3 - square - top button in landscape mode