*/\r
static inline void Endpoint_SetEndpointDirection(uint8_t DirectionMask);\r
#else\r
- #if defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR) || defined(__DOXYGEN__)\r
+ #if defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR)\r
#define Endpoint_BytesInEndpoint() UEBCX\r
#elif defined(USB_SERIES_4_AVR)\r
#define Endpoint_BytesInEndpoint() (((uint16_t)UEBCHX << 8) | UEBCLX) \r
* - Fixed TeensyHID bootloader not properly shutting down the USB interface to trigger a disconnection on the host before resetting\r
* - Fixed MassStorageHost Class driver demo not having USB_STREAM_TIMEOUT_MS compile time option set properly to prevent slow \r
* devices from timing out the data pipes\r
+ * - Fixed the definition of the Endpoint_BytesInEndpoint() macro for the U4 parts\r
*\r
* \section Sec_ChangeLog091122 Version 091122\r
*\r
/* Must hold DATA line high for at least 90nS to enable PDI interface */\r
PDIDATA_LINE_PORT |= PDIDATA_LINE_MASK;\r
asm volatile ("NOP"::);\r
- #if (F_CPU > 8000000)\r
asm volatile ("NOP"::);\r
- #endif\r
\r
/* Toggle CLOCK line 16 times within 100uS of the original 90nS timeout to keep PDI interface enabled */\r
for (uint8_t i = 0; i < 16; i++)\r
\r
/* Enable access to the XPROG NVM bus by sending the documented NVM access key to the device */\r
PDITarget_SendByte(PDI_CMD_KEY); \r
- for (uint8_t i = 0; i < 8; i++)\r
+ for (uint8_t i = 0; i < sizeof(PDI_NVMENABLE_KEY); i++)\r
PDITarget_SendByte(PDI_NVMENABLE_KEY[i]);\r
\r
/* Read out the STATUS register to check that NVM access was successfully enabled */\r
for (uint8_t i = 0; i < 8; i++)\r
{\r
if (Byte & 0x01)\r
- PDIDATA_LINE_PORT |= PDIDATA_LINE_MASK;\r
- else\r
PDIDATA_LINE_PORT &= ~PDIDATA_LINE_MASK;\r
+ else\r
+ PDIDATA_LINE_PORT |= PDIDATA_LINE_MASK;\r
\r
Byte >>= 1;\r
\r
#define PDIDATA_LINE_PORT PORTB\r
#define PDIDATA_LINE_DDR DDRB\r
#define PDIDATA_LINE_PIN PINB\r
- #define PDIDATA_LINE_MASK (1 << 2)\r
+ #define PDIDATA_LINE_MASK (1 << 3)\r
\r
#define PDICLOCK_LINE_PORT RESET_LINE_PORT\r
#define PDICLOCK_LINE_DDR RESET_LINE_DDR\r
#define PDI_NVMENABLE_KEY (uint8_t[]){0x12, 0x89, 0xAB, 0x45, 0xCD, 0xD8, 0x88, 0xFF}\r
\r
#define TOGGLE_PDI_CLOCK MACROS{ PDICLOCK_LINE_PORT ^= PDICLOCK_LINE_MASK; \\r
- PDICLOCK_LINE_PORT ^= PDICLOCK_LINE_MASK; }MACROE\r
+ asm volatile ("NOP" ::); \\r
+ PDICLOCK_LINE_PORT ^= PDICLOCK_LINE_MASK; \\r
+ asm volatile ("NOP" ::); }MACROE\r
\r
/* Function Prototypes: */\r
void PDITarget_SendByte(uint8_t Byte);\r
\r
\r
# MCU name\r
-MCU = at90usb1287\r
+MCU = at90usb162\r
\r
\r
# Target board (see library "Board Types" documentation, USER or blank for projects not requiring\r