diff options
Diffstat (limited to 'bootloaders/diskloader/src')
-rw-r--r-- | bootloaders/diskloader/src/DiskLoader.cpp | 8 | ||||
-rw-r--r-- | bootloaders/diskloader/src/Platform.h | 2 | ||||
-rw-r--r-- | bootloaders/diskloader/src/USBCore.cpp | 4 | ||||
-rw-r--r-- | bootloaders/diskloader/src/USBDesc.cpp | 19 | ||||
-rw-r--r-- | bootloaders/diskloader/src/USBDesc.h | 8 |
5 files changed, 31 insertions, 10 deletions
diff --git a/bootloaders/diskloader/src/DiskLoader.cpp b/bootloaders/diskloader/src/DiskLoader.cpp index f854fd1..1771d02 100644 --- a/bootloaders/diskloader/src/DiskLoader.cpp +++ b/bootloaders/diskloader/src/DiskLoader.cpp @@ -220,10 +220,10 @@ int main() u16 _pulse; void LEDPulse() { - _pulse++; - u8 p = _pulse >> 8; - if (p > 127) - p = 255-p; + _pulse += 4; + u8 p = _pulse >> 9; + if (p > 63) + p = 127-p; p += p; if (((u8)_pulse) > p) LED0; diff --git a/bootloaders/diskloader/src/Platform.h b/bootloaders/diskloader/src/Platform.h index 2b00b71..471bc90 100644 --- a/bootloaders/diskloader/src/Platform.h +++ b/bootloaders/diskloader/src/Platform.h @@ -19,6 +19,8 @@ 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); +#define USB_PID_LEONARDO 0x0034 +#define USB_PID_MICRO 0x0035 #define USB_VID 0x2341 // arduino LLC vid #define USB_PID ARDUINO_MODEL_PID // passed in by Makefile - 0x0034 for Leonardo, 0x0035 for MIcro diff --git a/bootloaders/diskloader/src/USBCore.cpp b/bootloaders/diskloader/src/USBCore.cpp index 1a8f2d0..ca74721 100644 --- a/bootloaders/diskloader/src/USBCore.cpp +++ b/bootloaders/diskloader/src/USBCore.cpp @@ -374,6 +374,10 @@ bool SendDescriptor() { if (setup.wValueL == 0) desc_addr = (const u8*)&STRING_LANGUAGE; + else if (setup.wValueL == IPRODUCT) + desc_addr = (const u8*)&STRING_IPRODUCT; + else if (setup.wValueL == IMANUFACTURER) + desc_addr = (const u8*)&STRING_IMANUFACTURER; else return false; } else diff --git a/bootloaders/diskloader/src/USBDesc.cpp b/bootloaders/diskloader/src/USBDesc.cpp index ec7cf7d..c8ea9c6 100644 --- a/bootloaders/diskloader/src/USBDesc.cpp +++ b/bootloaders/diskloader/src/USBDesc.cpp @@ -28,10 +28,25 @@ const u16 STRING_LANGUAGE[2] = { }; +const u16 STRING_IPRODUCT[28] = { + (3<<8) | (2+2*27), +#if USB_PID == USB_PID_LEONARDO + 'A','r','d','u','i','n','o',' ','L','e','o','n','a','r','d','o',' ','b','o','o','t','l','o','a','d','e','r' +#elif USB_PID == USB_PID_MICRO + 'A','r','d','u','i','n','o',' ','M','i','c','r','o',' ','b','o','o','t','l','o','a','d','e','r',' ',' ',' ' +#endif +}; + +const u16 STRING_IMANUFACTURER[12] = { + (3<<8) | (2+2*11), + 'A','r','d','u','i','n','o',' ','L','L','C' +}; + + //#ifdef CDC_ENABLED -DeviceDescriptor USB_DeviceDescriptorA = D_DEVICE(0X02,0X00,0X00,64,USB_VID,USB_PID,0x100,0,IPRODUCT,ISERIAL,1); +DeviceDescriptor USB_DeviceDescriptorA = D_DEVICE(0X02,0X00,0X00,64,USB_VID,USB_PID,0x100,IMANUFACTURER,IPRODUCT,0,1); //#else -DeviceDescriptor USB_DeviceDescriptor = D_DEVICE(0x00,0x00,0x00,64,USB_VID,USB_PID,0x100,0,IPRODUCT,ISERIAL,1); +DeviceDescriptor USB_DeviceDescriptor = D_DEVICE(0x00,0x00,0x00,64,USB_VID,USB_PID,0x100,IMANUFACTURER,IPRODUCT,0,1); //#endif Config USB_ConfigDescriptor = diff --git a/bootloaders/diskloader/src/USBDesc.h b/bootloaders/diskloader/src/USBDesc.h index 589dfa9..094dba5 100644 --- a/bootloaders/diskloader/src/USBDesc.h +++ b/bootloaders/diskloader/src/USBDesc.h @@ -53,11 +53,11 @@ extern DeviceDescriptor USB_DeviceDescriptor PROGMEM; extern DeviceDescriptor USB_DeviceDescriptorA PROGMEM; extern const u16 STRING_LANGUAGE[2] PROGMEM; -extern const u16 STRING_SERIAL[13] PROGMEM; +extern const u16 STRING_IPRODUCT[28] PROGMEM; +extern const u16 STRING_IMANUFACTURER[12] PROGMEM; -#define IMANUFACTURER 0 -#define IPRODUCT 0 -#define ISERIAL 1 // Only need this for MSC +#define IMANUFACTURER 1 +#define IPRODUCT 2 #define CDC_TX CDC_ENDPOINT_IN #define CDC_RX CDC_ENDPOINT_OUT
\ No newline at end of file |