Bootloader for Leonardo Boards

Hi,

I have an Leonardo compatile Board for my breadboard, unworthily it has the RX and TX LED connected to GND not to Vcc.

Original Leonardo

Pin -----[Resistor]---|<|------->Vcc

Clone Board

Pin -----[Resistor]---|>|-------|GND

So the RX and TX LED are always on, I don't like that and I'm aware about sunburn :wink:

My idea is changing on the caterina.h the following lines.

#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n))
//#define LED_SETUP() DDRC |= (1<<7); DDRB |= (1<<0); DDRD |= (1<<5);
68 #define LED_SETUP() DDRC |= (1<<7); DDRB &= ~(1<<0); DDRD &= ~(1<<5);
#define L_LED_OFF() PORTC &= ~(1<<7)
#define L_LED_ON() PORTC |= (1<<7)
#define L_LED_TOGGLE() PORTC ^= (1<<7)
//Definition changed!!!!
72 #define TX_LED_OFF() PORTD &= ~(1<<5)
73 #define TX_LED_ON() PORTD |= (1<<5)
74 #define RX_LED_OFF() PORTB &= ~(1<<0)
75 #define RX_LED_ON() PORTB |= (1<<0)

so that "ON" would be "OFF" and "OFF" would "ON" and inverted the LED_SETUP(). On my small mind I think that would be all that need to be changed to let the board work like the original one, and now the complicate (only if I think right about the changes) part I'm not able build the alternative Caterina-Bootloader.

So can someone build it? Would be very helpfully

The bootloader is only doing its thing for a few seconds, when resetting or loading a new sketch.

You could ignore it completely and make those changes in the pins_arduino.h header file and that will (should) handle things while your sketch is running.

It's in the hardware/arduino/variants/leonardo folder.

Then (I am pretty sure) you'll see the TX and RX leds working 'inverted' only when the bootloader is running, but the rest of the time they will work as intended.

Cheers!

Steph:
The bootloader is only doing its thing for a few seconds, when resetting or loading a new sketch.

You could ignore it completely and make those changes in the pins_arduino.h header file and that will (should) handle things while your sketch is running.

It's in the hardware/arduino/variants/leonardo folder.

Then (I am pretty sure) you'll see the TX and RX leds working 'inverted' only when the bootloader is running, but the rest of the time they will work as intended.

Cheers!

My fool you are right, for the 3 seconds of bootloader work it would not be relevant I changed it on the pins_arduino.h and make an new variant for it with adding a new board with the variant linked on the boards.txt.

I will test it later.

Thanks
Steph

Test it, works!