aboutsummaryrefslogtreecommitdiff
path: root/bootloaders/diskloader/src/USBCore.cpp
diff options
context:
space:
mode:
authorZach Eveland <zeveland@blacklabel-development.com>2011-08-14 16:02:16 -0400
committerZach Eveland <zeveland@blacklabel-development.com>2011-08-14 16:02:16 -0400
commitb8a2daf8bcda528be820eb0b76e6b15961cd71c0 (patch)
treecfe3dbacbfa18b8a3fc1426f5ee8f92b82f01c78 /bootloaders/diskloader/src/USBCore.cpp
parent5b453fd6069349f3e08dbe72a32eb6a2a60a6afb (diff)
LEDs for D13, TX, and RX are more in line with Uno-like behavior during sketch uploading.
D13 flashes on reboot, TX and RX flash with USB data transfer.
Diffstat (limited to 'bootloaders/diskloader/src/USBCore.cpp')
-rw-r--r--bootloaders/diskloader/src/USBCore.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/bootloaders/diskloader/src/USBCore.cpp b/bootloaders/diskloader/src/USBCore.cpp
index fbfad0e..52b960a 100644
--- a/bootloaders/diskloader/src/USBCore.cpp
+++ b/bootloaders/diskloader/src/USBCore.cpp
@@ -86,23 +86,27 @@ static inline void ClearOUT(void)
static
void Send(volatile const u8* data, u8 count)
{
+ TXLED1; // light the TX LED
while (count--)
UEDATX = *data++;
}
void Recv(volatile u8* data, u8 count)
{
+ RXLED1; // light the RX LED
while (count--)
*data++ = UEDATX;
}
static inline u8 Recv8()
{
+ RXLED1; // light the RX LED
return UEDATX;
}
static inline void Send8(u8 d)
{
+ TXLED1; // light the TX LED
UEDATX = d;
}
@@ -506,12 +510,17 @@ int USBGetChar()
u8 temp = 0;
for (temp=100; temp; temp--)
asm volatile("nop\n\t" "nop\n\t" "nop\n\t" "nop\n\t"::);
+ RXLED0; // we turn the RX and TX LEDs on in the relevant Send or Recv instruction
+ TXLED0; // we turn them off here after some time has passed to ensure a minimum on time.
}
- if (!--_timeout)
+ if (!--_timeout) {
+ TXLED0; // switch off the RX and TX LEDs before starting the user sketch
+ RXLED0;
Reboot(); // USB not connected, run firmware
+ }
- LEDPulse();
+// LEDPulse();
}
return -1;
}