Add newlines to the MIDI event printf() statements in the MIDI host demos.
\r
if (NoteOnEvent || NoteOffEvent)\r
{\r
- printf_P(PSTR("MIDI Note %s - Channel %d, Pitch %d, Velocity %d"), NoteOnEvent ? "On" : "Off",\r
- ((MIDIEvent.Data1 & 0x0F) + 1),\r
- MIDIEvent.Data2, MIDIEvent.Data3);\r
+ printf_P(PSTR("MIDI Note %s - Channel %d, Pitch %d, Velocity %d\r\n"), NoteOnEvent ? "On" : "Off",\r
+ ((MIDIEvent.Data1 & 0x0F) + 1),\r
+ MIDIEvent.Data2, MIDIEvent.Data3);\r
}\r
}\r
\r
\r
if (NoteOnEvent || NoteOffEvent)\r
{\r
- printf_P(PSTR("MIDI Note %s - Channel %d, Pitch %d, Velocity %d"), NoteOnEvent ? "On" : "Off",\r
- ((MIDIEvent.Data1 & 0x0F) + 1),\r
- MIDIEvent.Data2, MIDIEvent.Data3);\r
+ printf_P(PSTR("MIDI Note %s - Channel %d, Pitch %d, Velocity %d\r\n"), NoteOnEvent ? "On" : "Off",\r
+ ((MIDIEvent.Data1 & 0x0F) + 1),\r
+ MIDIEvent.Data2, MIDIEvent.Data3);\r
}\r
\r
Pipe_ClearIN();\r
* - Fixed ADC routines not correctly returning the last result when multiple channels were read\r
* - Fixed ADC routines failing to read the extended channels (Channels 8 to 13, Internal Temperature Sensor) on the\r
* U4 series USB AVR parts\r
+ * - Fixed PDI programming mode in the AVRISP programmer project not exiting programming mode correctly (clear target\r
+ * Reset key twice, set /RESET pin to pullup)\r
*\r
* \section Sec_ChangeLog100219 Version 100219\r
*\r
{\r
/* Enable PDI programming mode with the attached target */\r
XPROGTarget_EnableTargetPDI();\r
- \r
+\r
/* Store the RESET key into the RESET PDI register to keep the XMEGA in reset */\r
XPROGTarget_SendByte(PDI_CMD_STCS | PDI_RESET_REG); \r
XPROGTarget_SendByte(PDI_RESET_KEY);\r
\r
if (XPROG_SelectedProtocol == XPRG_PROTOCOL_PDI)\r
{\r
+ XMEGANVM_WaitWhileNVMBusBusy();\r
+\r
/* Clear the RESET key in the RESET PDI register to allow the XMEGA to run */\r
XPROGTarget_SendByte(PDI_CMD_STCS | PDI_RESET_REG); \r
XPROGTarget_SendByte(0x00);\r
+ \r
+ /* Clear /RESET key twice (for some reason this needs to be done twice to take effect) */\r
+ XPROGTarget_SendByte(PDI_CMD_STCS | PDI_RESET_REG); \r
+ XPROGTarget_SendByte(0x00);\r
\r
XPROGTarget_DisableTargetPDI();\r
}\r
else\r
{\r
+ TINYNVM_WaitWhileNVMBusBusy();\r
+\r
/* Clear the NVMEN bit in the TPI CONTROL register to disable TPI mode */\r
XPROGTarget_SendByte(TPI_CMD_SSTCS | TPI_CTRL_REG); \r
XPROGTarget_SendByte(0x00);\r
XPROGTarget_SetRxMode();\r
\r
#if defined(XPROG_VIA_HARDWARE_USART)\r
- /* Set /RESET high for a one millisecond to ensure target device is restarted */\r
- PORTD |= (1 << 5);\r
- _delay_ms(1);\r
-\r
/* Turn off receiver and transmitter of the USART, clear settings */\r
- UCSR1A |= (1 << TXC1) | (1 << RXC1);\r
+ UCSR1A = ((1 << TXC1) | (1 << RXC1));\r
UCSR1B = 0;\r
UCSR1C = 0;\r
\r
- /* Set all USART lines as input, tristate */\r
+ /* Make Reset input with pullup to take target out of /RESET, tristate all other pins */\r
DDRD &= ~((1 << 5) | (1 << 3));\r
- PORTD &= ~((1 << 5) | (1 << 3) | (1 << 2));\r
+ PORTD &= ~((1 << 3) | (1 << 2));\r
+ PORTD |= (1 << 5);\r
#else\r
/* Turn off software USART management timer */\r
TCCR1B = 0;\r
\r
- /* Set /RESET high for a one millisecond to ensure target device is restarted */\r
- BITBANG_PDICLOCK_PORT |= BITBANG_PDICLOCK_MASK;\r
- _delay_ms(1);\r
-\r
- /* Set DATA and CLOCK lines to inputs */\r
+ /* Make Reset input with pullup to take target out of /RESET, tristate all other pins */\r
BITBANG_PDIDATA_DDR &= ~BITBANG_PDIDATA_MASK;\r
BITBANG_PDICLOCK_DDR &= ~BITBANG_PDICLOCK_MASK;\r
- \r
- /* Tristate DATA and CLOCK lines */\r
- BITBANG_PDIDATA_PORT &= ~BITBANG_PDIDATA_MASK;\r
BITBANG_PDICLOCK_PORT &= ~BITBANG_PDICLOCK_MASK; \r
+ BITBANG_PDIDATA_PORT |= BITBANG_PDIDATA_MASK;\r
#endif\r
}\r
\r