Don't ever define PIN_LED or BLE_LED_INVERTED (#9494)
* Don't ever define PIN_LED * Deprecate BLE_LED_INVERTED
This commit is contained in:
co-authored by
GitHub
parent
7b03980e0a
commit
1d30342c00
+2
-10
@@ -89,22 +89,14 @@ class BluetoothStatus : public Status
|
|||||||
case ConnectionState::CONNECTED:
|
case ConnectionState::CONNECTED:
|
||||||
LOG_DEBUG("BluetoothStatus CONNECTED");
|
LOG_DEBUG("BluetoothStatus CONNECTED");
|
||||||
#ifdef BLE_LED
|
#ifdef BLE_LED
|
||||||
#ifdef BLE_LED_INVERTED
|
digitalWrite(BLE_LED, LED_STATE_ON);
|
||||||
digitalWrite(BLE_LED, LOW);
|
|
||||||
#else
|
|
||||||
digitalWrite(BLE_LED, HIGH);
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ConnectionState::DISCONNECTED:
|
case ConnectionState::DISCONNECTED:
|
||||||
LOG_DEBUG("BluetoothStatus DISCONNECTED");
|
LOG_DEBUG("BluetoothStatus DISCONNECTED");
|
||||||
#ifdef BLE_LED
|
#ifdef BLE_LED
|
||||||
#ifdef BLE_LED_INVERTED
|
digitalWrite(BLE_LED, LED_STATE_OFF);
|
||||||
digitalWrite(BLE_LED, HIGH);
|
|
||||||
#else
|
|
||||||
digitalWrite(BLE_LED, LOW);
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-6
@@ -366,11 +366,7 @@ void setup()
|
|||||||
|
|
||||||
#ifdef BLE_LED
|
#ifdef BLE_LED
|
||||||
pinMode(BLE_LED, OUTPUT);
|
pinMode(BLE_LED, OUTPUT);
|
||||||
#ifdef BLE_LED_INVERTED
|
digitalWrite(BLE_LED, LED_STATE_OFF);
|
||||||
digitalWrite(BLE_LED, HIGH);
|
|
||||||
#else
|
|
||||||
digitalWrite(BLE_LED, LOW);
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
concurrency::hasBeenSetup = true;
|
concurrency::hasBeenSetup = true;
|
||||||
@@ -493,7 +489,9 @@ void setup()
|
|||||||
// The ThinkNodes have their own blink logic
|
// The ThinkNodes have their own blink logic
|
||||||
// ledPeriodic = new Periodic("Blink", elecrowLedBlinker);
|
// ledPeriodic = new Periodic("Blink", elecrowLedBlinker);
|
||||||
#else
|
#else
|
||||||
|
|
||||||
ledPeriodic = new Periodic("Blink", ledBlinker);
|
ledPeriodic = new Periodic("Blink", ledBlinker);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
fsInit();
|
fsInit();
|
||||||
@@ -834,7 +832,7 @@ void setup()
|
|||||||
SPI.begin();
|
SPI.begin();
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
// ESP32
|
// ESP32
|
||||||
#if defined(HW_SPI1_DEVICE)
|
#if defined(HW_SPI1_DEVICE)
|
||||||
SPI1.begin(LORA_SCK, LORA_MISO, LORA_MOSI, LORA_CS);
|
SPI1.begin(LORA_SCK, LORA_MISO, LORA_MOSI, LORA_CS);
|
||||||
LOG_DEBUG("SPI1.begin(SCK=%d, MISO=%d, MOSI=%d, NSS=%d)", LORA_SCK, LORA_MISO, LORA_MOSI, LORA_CS);
|
LOG_DEBUG("SPI1.begin(SCK=%d, MISO=%d, MOSI=%d, NSS=%d)", LORA_SCK, LORA_MISO, LORA_MOSI, LORA_CS);
|
||||||
|
|||||||
@@ -757,11 +757,7 @@ void NimbleBluetooth::deinit()
|
|||||||
isDeInit = true;
|
isDeInit = true;
|
||||||
|
|
||||||
#ifdef BLE_LED
|
#ifdef BLE_LED
|
||||||
#ifdef BLE_LED_INVERTED
|
digitalWrite(BLE_LED, LED_STATE_OFF);
|
||||||
digitalWrite(BLE_LED, HIGH);
|
|
||||||
#else
|
|
||||||
digitalWrite(BLE_LED, LOW);
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
#ifndef NIMBLE_TWO
|
#ifndef NIMBLE_TWO
|
||||||
NimBLEDevice::deinit();
|
NimBLEDevice::deinit();
|
||||||
|
|||||||
@@ -26,7 +26,6 @@
|
|||||||
#undef GPS_TX_PIN
|
#undef GPS_TX_PIN
|
||||||
#define NO_GPS 1
|
#define NO_GPS 1
|
||||||
#define HAS_GPS 0
|
#define HAS_GPS 0
|
||||||
#define NO_SCREEN
|
|
||||||
#define HAS_SCREEN 0
|
#define HAS_SCREEN 0
|
||||||
|
|
||||||
// Default SPI1 will be mapped to the display
|
// Default SPI1 will be mapped to the display
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
#define EXT_NOTIFY_OUT 22
|
#define EXT_NOTIFY_OUT 22
|
||||||
#define BUTTON_PIN 0 // 17
|
#define BUTTON_PIN 0 // 17
|
||||||
|
|
||||||
// #define LED_PIN PIN_LED
|
|
||||||
// Board has RGB LED 21
|
// Board has RGB LED 21
|
||||||
#define HAS_NEOPIXEL // Enable the use of neopixels
|
#define HAS_NEOPIXEL // Enable the use of neopixels
|
||||||
#define NEOPIXEL_COUNT 1 // How many neopixels are connected
|
#define NEOPIXEL_COUNT 1 // How many neopixels are connected
|
||||||
|
|||||||
@@ -35,8 +35,6 @@ extern "C" {
|
|||||||
#define PIN_LED2 LED_BLUE
|
#define PIN_LED2 LED_BLUE
|
||||||
#define PIN_LED3 LED_RED
|
#define PIN_LED3 LED_RED
|
||||||
|
|
||||||
#define PIN_LED PIN_LED1
|
|
||||||
|
|
||||||
#define LED_STATE_ON 1 // State when LED is lit
|
#define LED_STATE_ON 1 // State when LED is lit
|
||||||
|
|
||||||
// XIAO Wio-SX1262 Shield User button
|
// XIAO Wio-SX1262 Shield User button
|
||||||
|
|||||||
@@ -51,7 +51,6 @@ extern "C" {
|
|||||||
#define LED_GREEN PIN_LED1
|
#define LED_GREEN PIN_LED1
|
||||||
|
|
||||||
#define BLE_LED LED_BLUE
|
#define BLE_LED LED_BLUE
|
||||||
#define BLE_LED_INVERTED 1
|
|
||||||
#define LED_STATE_ON 0 // State when LED is lit
|
#define LED_STATE_ON 0 // State when LED is lit
|
||||||
|
|
||||||
// Buttons
|
// Buttons
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
#define ADC_RESOLUTION (12u)
|
#define ADC_RESOLUTION (12u)
|
||||||
|
|
||||||
// LEDs
|
// LEDs
|
||||||
#define PIN_LED (24u)
|
#define LED_PIN (24u)
|
||||||
|
|
||||||
// Serial
|
// Serial
|
||||||
#define PIN_SERIAL1_TX (16u)
|
#define PIN_SERIAL1_TX (16u)
|
||||||
|
|||||||
@@ -5,8 +5,6 @@
|
|||||||
#define EXT_NOTIFY_OUT 0xFFFFFFFF
|
#define EXT_NOTIFY_OUT 0xFFFFFFFF
|
||||||
#define BUTTON_PIN 0xFFFFFFFF
|
#define BUTTON_PIN 0xFFFFFFFF
|
||||||
|
|
||||||
#define LED_PIN PIN_LED
|
|
||||||
|
|
||||||
#define USE_RF95 // RFM95/SX127x
|
#define USE_RF95 // RFM95/SX127x
|
||||||
|
|
||||||
#undef LORA_SCK
|
#undef LORA_SCK
|
||||||
|
|||||||
@@ -23,8 +23,7 @@ static const uint8_t A2 = PIN_A2;
|
|||||||
static const uint8_t A3 = PIN_A3;
|
static const uint8_t A3 = PIN_A3;
|
||||||
|
|
||||||
// LEDs
|
// LEDs
|
||||||
#define PIN_LED (23u)
|
#define PIN_LED1 (23u)
|
||||||
#define PIN_LED1 PIN_LED
|
|
||||||
#define LED_NOTIFICATION (24u)
|
#define LED_NOTIFICATION (24u)
|
||||||
|
|
||||||
#define ADC_RESOLUTION 12
|
#define ADC_RESOLUTION 12
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
#define I2C_SDA1 2
|
#define I2C_SDA1 2
|
||||||
#define I2C_SCL1 3
|
#define I2C_SCL1 3
|
||||||
|
|
||||||
#define LED_PIN PIN_LED
|
#define LED_PIN PIN_LED1
|
||||||
#define ledOff(pin) pinMode(pin, INPUT)
|
#define ledOff(pin) pinMode(pin, INPUT)
|
||||||
|
|
||||||
#define BUTTON_PIN 9
|
#define BUTTON_PIN 9
|
||||||
|
|||||||
@@ -11,8 +11,7 @@ static const uint8_t A2 = PIN_A2;
|
|||||||
static const uint8_t A3 = PIN_A3;
|
static const uint8_t A3 = PIN_A3;
|
||||||
|
|
||||||
// LEDs
|
// LEDs
|
||||||
#define PIN_LED (23u)
|
#define PIN_LED1 (23u)
|
||||||
#define PIN_LED1 PIN_LED
|
|
||||||
|
|
||||||
#define ADC_RESOLUTION 12
|
#define ADC_RESOLUTION 12
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
#define BUTTON_PIN 2
|
#define BUTTON_PIN 2
|
||||||
#define BUTTON_NEED_PULLUP
|
#define BUTTON_NEED_PULLUP
|
||||||
|
|
||||||
#define LED_PIN PIN_LED
|
#define LED_PIN PIN_LED1
|
||||||
#define ledOff(pin) pinMode(pin, INPUT)
|
#define ledOff(pin) pinMode(pin, INPUT)
|
||||||
|
|
||||||
#undef BATTERY_PIN
|
#undef BATTERY_PIN
|
||||||
|
|||||||
Reference in New Issue
Block a user