Skip to content

Commit

Permalink
Add LED_BUILTIN* definitions and initialization for LEDs to stop them…
Browse files Browse the repository at this point in the history
… floating. (#7636)

Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com>
  • Loading branch information
2 people authored and me-no-dev committed Feb 7, 2023
1 parent a3a1e7e commit 5ad55c5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions variants/AirM2M_CORE_ESP32C3/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
#define digitalPinToInterrupt(p) (((p)<NUM_DIGITAL_PINS)?(p):-1)
#define digitalPinHasPWM(p) (p < EXTERNAL_NUM_INTERRUPTS)

static const uint8_t LED_BUILTIN = 12;
#define BUILTIN_LED LED_BUILTIN
static const uint8_t LED_BUILTIN_AUX = 13;

static const uint8_t TX = 21;
static const uint8_t RX = 20;

Expand Down
7 changes: 7 additions & 0 deletions variants/AirM2M_CORE_ESP32C3/variant.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include "Arduino.h"

extern "C" void initVariant(void){
// Stop LEDs floating
pinMode(LED_BUILTIN, OUTPUT); digitalWrite(LED_BUILTIN, LOW);
pinMode(LED_BUILTIN_AUX, OUTPUT); digitalWrite(LED_BUILTIN_AUX, LOW);
}

0 comments on commit 5ad55c5

Please sign in to comment.