Skip to content

Added TXLed to Leonardo pin definition file #3680

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 24, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions build/shared/lib/keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ INTERNAL LITERAL2 AnalogReference RESERVED_WORD_2
INTERNAL1V1 LITERAL2 AnalogReference RESERVED_WORD_2
INTERNAL2V56 LITERAL2 AnalogReference RESERVED_WORD_2
LED_BUILTIN LITERAL2 RESERVED_WORD_2
LED_BUILTIN_RX LITERAL2 RESERVED_WORD_2
LED_BUILTIN_TX LITERAL2 RESERVED_WORD_2

auto LITERAL2 RESERVED_WORD_2
constexpr LITERAL2 RESERVED_WORD_2
Expand Down
13 changes: 10 additions & 3 deletions hardware/arduino/avr/variants/leonardo/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
#undef OCR2_6
#undef OCR2_7

#define NUM_DIGITAL_PINS 30
#define NUM_DIGITAL_PINS 31
#define NUM_ANALOG_INPUTS 12

#define TX_RX_LED_INIT DDRD |= (1<<5), DDRB |= (1<<0)
Expand All @@ -100,6 +100,8 @@
static const uint8_t SDA = 2;
static const uint8_t SCL = 3;
#define LED_BUILTIN 13
#define LED_BUILTIN_RX 17
#define LED_BUILTIN_TX 30

// Map SPI port to 'new' pins D14..D17
static const uint8_t SS = 17;
Expand Down Expand Up @@ -131,6 +133,8 @@ static const uint8_t A11 = 29; // D12
extern const uint8_t PROGMEM analog_pin_to_channel_PGM[];
#define analogPinToChannel(P) ( pgm_read_byte( analog_pin_to_channel_PGM + (P) ) )

#define digitalPinHasPWM(p) ((p) == 3 || (p) == 5 || (p) == 6 || (p) == 9 || (p) == 10 || (p) == 11 || (p) == 13)

#define digitalPinToInterrupt(p) ((p) == 0 ? 2 : ((p) == 1 ? 3 : ((p) == 2 ? 1 : ((p) == 3 ? 0 : ((p) == 7 ? 4 : NOT_AN_INTERRUPT)))))

#ifdef ARDUINO_MAIN
Expand Down Expand Up @@ -171,8 +175,8 @@ extern const uint8_t PROGMEM analog_pin_to_channel_PGM[];
// MOSI D16 PB2 MOSI,PCINT2
// SS D17 PB0 RXLED,SS/PCINT0
//
// TXLED PD5
// RXLED PB0
// TXLED D30 PD5 XCK1
// RXLED D17 PB0
// HWB PE2 HWB

// these arrays map port names (e.g. port B) to the
Expand Down Expand Up @@ -243,6 +247,7 @@ const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
PB, // D27 / D9 - A9 - PB5
PB, // D28 / D10 - A10 - PB6
PD, // D29 / D12 - A11 - PD6
PD, // D30 / TX Led - PD5
};

const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = {
Expand Down Expand Up @@ -280,6 +285,7 @@ const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = {
_BV(5), // D27 / D9 - A9 - PB5
_BV(6), // D28 / D10 - A10 - PB6
_BV(6), // D29 / D12 - A11 - PD6
_BV(5), // D30 / TX Led - PD5
};

const uint8_t PROGMEM digital_pin_to_timer_PGM[] = {
Expand Down Expand Up @@ -317,6 +323,7 @@ const uint8_t PROGMEM digital_pin_to_timer_PGM[] = {
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
};

const uint8_t PROGMEM analog_pin_to_channel_PGM[] = {
Expand Down