From 648dd85e945a7e0a2db284987377a97936ee77e4 Mon Sep 17 00:00:00 2001 From: Zach Eveland Date: Tue, 10 Jan 2012 15:31:56 -0500 Subject: added conditional compilation for HID, removed conditional compilation for CDC (is always used). disabled HID by default. also always enumerates as composite now. the bootloader must always have a CDC interface. HID is optional and not even complete to reduce size. --- bootloaders/diskloader/src/Platform.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'bootloaders/diskloader/src/Platform.h') diff --git a/bootloaders/diskloader/src/Platform.h b/bootloaders/diskloader/src/Platform.h index 04c5b79..fcce0a1 100644 --- a/bootloaders/diskloader/src/Platform.h +++ b/bootloaders/diskloader/src/Platform.h @@ -43,7 +43,10 @@ void Transfer(u8 ep, const u8* data, int len); void Recv(u8 ep, u8* dst, u8 len); void Program(u8 ep, u16 page, u8 count); -#define CDC_ENABLED +/* HID is not fully-supported in the bootloader - can be enabled + for testing, but note the descriptor report and other parts are + not complete */ +//#define HID_ENABLED #include "USBCore.h" #include "USBDesc.h" -- cgit v1.2.3-18-g5258 From dbec0f0058fdf33ef95b57f130c5ff8986f5c359 Mon Sep 17 00:00:00 2001 From: Zach Eveland Date: Tue, 10 Jan 2012 15:38:26 -0500 Subject: made the bootloader's LED control macro names less offensive TX_LED_OFF() instead of TXLED0, etc. --- bootloaders/diskloader/src/Platform.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'bootloaders/diskloader/src/Platform.h') diff --git a/bootloaders/diskloader/src/Platform.h b/bootloaders/diskloader/src/Platform.h index fcce0a1..2e90334 100644 --- a/bootloaders/diskloader/src/Platform.h +++ b/bootloaders/diskloader/src/Platform.h @@ -28,12 +28,12 @@ typedef unsigned long u32; #define OEM_NAME 'l','e','o','n','a','r','d','o' // 8 chars #define BOARD_INIT() DDRC |= (1<<7); DDRB |= (1<<0); DDRD |= (1<<5); CPU_PRESCALE(0); DISABLE_JTAG(); -#define LED0 PORTC &= ~(1<<7) -#define LED1 PORTC |= (1<<7) -#define TXLED0 PORTD |= (1<<5) -#define TXLED1 PORTD &= ~(1<<5) -#define RXLED0 PORTB |= (1<<0) -#define RXLED1 PORTB &= ~(1<<0) +#define L_LED_OFF() PORTC &= ~(1<<7) +#define L_LED_ON() PORTC |= (1<<7) +#define TX_LED_OFF() PORTD |= (1<<5) +#define TX_LED_ON() PORTD &= ~(1<<5) +#define RX_LED_OFF() PORTB |= (1<<0) +#define RX_LED_ON() PORTB &= ~(1<<0) #define TRANSFER_PGM 0x80 #define TRANSFER_RELEASE 0x40 -- cgit v1.2.3-18-g5258 From 94443a2a7700976c148843c2bb7d46e05744cff8 Mon Sep 17 00:00:00 2001 From: Zach Eveland Date: Tue, 10 Jan 2012 15:51:44 -0500 Subject: got rid of u8, u16, u32 typedefs in Diskloader done to bring types in line with others in Arduino core --- bootloaders/diskloader/src/Platform.h | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'bootloaders/diskloader/src/Platform.h') diff --git a/bootloaders/diskloader/src/Platform.h b/bootloaders/diskloader/src/Platform.h index 2e90334..57dc7d5 100644 --- a/bootloaders/diskloader/src/Platform.h +++ b/bootloaders/diskloader/src/Platform.h @@ -11,11 +11,6 @@ #include #include -typedef unsigned char u8; -typedef unsigned short u16; -typedef unsigned long u32; - - #define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n)) #define DISABLE_JTAG() MCUCR = (1 << JTD) | (1 << IVCE) | (0 << PUD); MCUCR = (1 << JTD) | (0 << IVSEL) | (0 << IVCE) | (0 << PUD); @@ -39,9 +34,9 @@ typedef unsigned long u32; #define TRANSFER_RELEASE 0x40 #define TRANSFER_ZERO 0x20 -void Transfer(u8 ep, const u8* data, int len); -void Recv(u8 ep, u8* dst, u8 len); -void Program(u8 ep, u16 page, u8 count); +void Transfer(uint8_t ep, const uint8_t* data, int len); +void Recv(uint8_t ep, uint8_t* dst, uint8_t len); +void Program(uint8_t ep, uint16_t page, uint8_t count); /* HID is not fully-supported in the bootloader - can be enabled for testing, but note the descriptor report and other parts are -- cgit v1.2.3-18-g5258 From 63a86b67ca5944ce7ecee1af861a90d72e7af51d Mon Sep 17 00:00:00 2001 From: Zach Eveland Date: Tue, 10 Jan 2012 16:09:56 -0500 Subject: changed USB PID for Leonardo and Micro bootloaders sketch and bootloader will use different PIDs to distinguish one from the other. --- bootloaders/diskloader/src/Platform.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bootloaders/diskloader/src/Platform.h') diff --git a/bootloaders/diskloader/src/Platform.h b/bootloaders/diskloader/src/Platform.h index 57dc7d5..9d18e80 100644 --- a/bootloaders/diskloader/src/Platform.h +++ b/bootloaders/diskloader/src/Platform.h @@ -14,8 +14,8 @@ #define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n)) #define DISABLE_JTAG() MCUCR = (1 << JTD) | (1 << IVCE) | (0 << PUD); MCUCR = (1 << JTD) | (0 << IVSEL) | (0 << IVCE) | (0 << PUD); -#define USB_PID_LEONARDO 0x0034 -#define USB_PID_MICRO 0x0035 +#define USB_PID_LEONARDO_BOOTLOADER 0x0030 +#define USB_PID_MICRO_BOOTLOADER 0x0031 #define USB_VID 0x2341 // arduino LLC vid #define USB_PID ARDUINO_MODEL_PID // passed in by Makefile - 0x0034 for Leonardo, 0x0035 for MIcro -- cgit v1.2.3-18-g5258 From 0ed2d3c95309ecf5905ec06624fc68955fdbd2d0 Mon Sep 17 00:00:00 2001 From: Zach Eveland Date: Tue, 10 Jan 2012 16:29:47 -0500 Subject: renamed DiskLoader to Caterina (after Leonardo's mom) --- bootloaders/diskloader/src/Platform.h | 49 ----------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 bootloaders/diskloader/src/Platform.h (limited to 'bootloaders/diskloader/src/Platform.h') diff --git a/bootloaders/diskloader/src/Platform.h b/bootloaders/diskloader/src/Platform.h deleted file mode 100644 index 9d18e80..0000000 --- a/bootloaders/diskloader/src/Platform.h +++ /dev/null @@ -1,49 +0,0 @@ - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n)) -#define DISABLE_JTAG() MCUCR = (1 << JTD) | (1 << IVCE) | (0 << PUD); MCUCR = (1 << JTD) | (0 << IVSEL) | (0 << IVCE) | (0 << PUD); - -#define USB_PID_LEONARDO_BOOTLOADER 0x0030 -#define USB_PID_MICRO_BOOTLOADER 0x0031 -#define USB_VID 0x2341 // arduino LLC vid -#define USB_PID ARDUINO_MODEL_PID // passed in by Makefile - 0x0034 for Leonardo, 0x0035 for MIcro - -#define USB_SERIAL_STRING '0','0','0','0','0','0','0','0','1','7','0','1' - -#define OEM_NAME 'l','e','o','n','a','r','d','o' // 8 chars -#define BOARD_INIT() DDRC |= (1<<7); DDRB |= (1<<0); DDRD |= (1<<5); CPU_PRESCALE(0); DISABLE_JTAG(); -#define L_LED_OFF() PORTC &= ~(1<<7) -#define L_LED_ON() PORTC |= (1<<7) -#define TX_LED_OFF() PORTD |= (1<<5) -#define TX_LED_ON() PORTD &= ~(1<<5) -#define RX_LED_OFF() PORTB |= (1<<0) -#define RX_LED_ON() PORTB &= ~(1<<0) - -#define TRANSFER_PGM 0x80 -#define TRANSFER_RELEASE 0x40 -#define TRANSFER_ZERO 0x20 - -void Transfer(uint8_t ep, const uint8_t* data, int len); -void Recv(uint8_t ep, uint8_t* dst, uint8_t len); -void Program(uint8_t ep, uint16_t page, uint8_t count); - -/* HID is not fully-supported in the bootloader - can be enabled - for testing, but note the descriptor report and other parts are - not complete */ -//#define HID_ENABLED - -#include "USBCore.h" -#include "USBDesc.h" - - -- cgit v1.2.3-18-g5258