projects
/
pub
/
USBasp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move the length decrements in the pipe and endpoint stream functions to the point...
[pub/USBasp.git]
/
Bootloaders
/
TeensyHID
/
TeensyHID.c
diff --git
a/Bootloaders/TeensyHID/TeensyHID.c
b/Bootloaders/TeensyHID/TeensyHID.c
index
4f09ac5
..
cb1407a
100644
(file)
--- a/
Bootloaders/TeensyHID/TeensyHID.c
+++ b/
Bootloaders/TeensyHID/TeensyHID.c
@@
-53,8
+53,8
@@
int main(void)
MCUSR &= ~(1 << WDRF);
\r
wdt_disable();
\r
\r
MCUSR &= ~(1 << WDRF);
\r
wdt_disable();
\r
\r
- /* Disable
Clock D
ivision */
\r
-
SetSystemClockPrescaler(0
);
\r
+ /* Disable
clock d
ivision */
\r
+
clock_prescale_set(clock_div_1
);
\r
\r
/* Relocate the interrupt vector table to the bootloader section */
\r
MCUCR = (1 << IVCE);
\r
\r
/* Relocate the interrupt vector table to the bootloader section */
\r
MCUCR = (1 << IVCE);
\r
@@
-96,15
+96,15
@@
EVENT_HANDLER(USB_ConfigurationChanged)
EVENT_HANDLER(USB_UnhandledControlPacket)
\r
{
\r
/* Handle HID Class specific requests */
\r
EVENT_HANDLER(USB_UnhandledControlPacket)
\r
{
\r
/* Handle HID Class specific requests */
\r
- switch (bRequest)
\r
+ switch (
USB_ControlRequest.
bRequest)
\r
{
\r
case REQ_SetReport:
\r
{
\r
case REQ_SetReport:
\r
- if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
\r
+ if (
USB_ControlRequest.
bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
\r
{
\r
{
\r
- Endpoint_ClearS
etupReceived
();
\r
+ Endpoint_ClearS
ETUP
();
\r
\r
/* Wait until the command (report) has been sent by the host */
\r
\r
/* Wait until the command (report) has been sent by the host */
\r
- while (!(Endpoint_Is
Setup
OUTReceived()));
\r
+ while (!(Endpoint_IsOUTReceived()));
\r
\r
/* Read in the write destination address */
\r
uint16_t PageAddress = Endpoint_Read_Word_LE();
\r
\r
/* Read in the write destination address */
\r
uint16_t PageAddress = Endpoint_Read_Word_LE();
\r
@@
-126,8
+126,8
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
/* Check if endpoint is empty - if so clear it and wait until ready for next packet */
\r
if (!(Endpoint_BytesInEndpoint()))
\r
{
\r
/* Check if endpoint is empty - if so clear it and wait until ready for next packet */
\r
if (!(Endpoint_BytesInEndpoint()))
\r
{
\r
- Endpoint_Clear
Setup
OUT();
\r
- while (!(Endpoint_Is
Setup
OUTReceived()));
\r
+ Endpoint_ClearOUT();
\r
+ while (!(Endpoint_IsOUTReceived()));
\r
}
\r
\r
/* Write the next data word to the FLASH page */
\r
}
\r
\r
/* Write the next data word to the FLASH page */
\r
@@
-142,13
+142,11
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
boot_rww_enable();
\r
}
\r
\r
boot_rww_enable();
\r
}
\r
\r
- Endpoint_Clear
Setup
OUT();
\r
+ Endpoint_ClearOUT();
\r
\r
\r
- /* Wait until the host is ready to receive the request confirmation */
\r
- while (!(Endpoint_IsSetupINReady()));
\r
-
\r
- /* Handshake the request by sending an empty IN packet */
\r
- Endpoint_ClearSetupIN();
\r
+ /* Acknowledge status stage */
\r
+ while (!(Endpoint_IsINReady()));
\r
+ Endpoint_ClearIN();
\r
}
\r
\r
break;
\r
}
\r
\r
break;
\r