Skip to content

Commit

Permalink
Make it possible to define LED_BUILTIN in the build process
Browse files Browse the repository at this point in the history
  • Loading branch information
MCUdude committed Aug 29, 2023
1 parent 8b5f16e commit c87824f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
4 changes: 3 additions & 1 deletion avr/variants/100-pin-arduino-mega/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
#define digitalPinHasPWM(p) (((p) >= 2 && (p) <= 13) || ((p) >= 44 && (p)<= 46))

// Builtin LED
#define LED_BUILTIN (13)
#if !defined(LED_BUILTIN)
#define LED_BUILTIN (13)
#endif
static const uint8_t LED = LED_BUILTIN;

// SPI
Expand Down
16 changes: 10 additions & 6 deletions avr/variants/100-pin-avr/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
((p) >= 29 && (p)<= 31) || \
((p) == 85))
// Builtin LED
#define LED_BUILTIN (22)
#if !defined(LED_BUILTIN)
#define LED_BUILTIN (22)
#endif
static const uint8_t LED = LED_BUILTIN;

// SPI defs
Expand Down Expand Up @@ -541,7 +543,9 @@
#define digitalPinHasPWM(p) (((p) >= 14 && (p) <= 17))

// Builtin LED
#define LED_BUILTIN (17)
#if !defined(LED_BUILTIN)
#define LED_BUILTIN (17)
#endif
static const uint8_t LED = LED_BUILTIN;

// SPI defs
Expand All @@ -559,7 +563,7 @@
#define PIN_WIRE_SCL (4)
static const uint8_t SDA = PIN_WIRE_SDA;
static const uint8_t SCL = PIN_WIRE_SCL;

// Serial defs
#define SERIAL_PORT_MONITOR Serial
#define SERIAL_PORT_HARDWARE Serial
Expand Down Expand Up @@ -611,7 +615,7 @@
static const uint8_t A5 = PIN_A5;
static const uint8_t A6 = PIN_A6;
static const uint8_t A7 = PIN_A7;

// PIN macros
#define PIN_PE0 0
#define PIN_PE1 1
Expand Down Expand Up @@ -724,7 +728,7 @@
NOT_A_PIN,
(uint16_t) &PINJ,
};

// Port list
const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
PE, // PE 0 ** 0
Expand Down Expand Up @@ -940,7 +944,7 @@
NOT_ON_TIMER, // PF 6 ** 66
NOT_ON_TIMER, // PF 7 ** 67
};

#endif //ARDUINO_MAIN

#endif // ATmega3250, ATmega3290, ATmega6450, ATmega6490
Expand Down
4 changes: 3 additions & 1 deletion avr/variants/64-pin-avr/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@
#endif

// Builtin LED
#define LED_BUILTIN (13)
#if !defined(LED_BUILTIN)
#define LED_BUILTIN (13)
#endif
static const uint8_t LED = LED_BUILTIN;

// Analog pins
Expand Down

0 comments on commit c87824f

Please sign in to comment.