projects
/
pub
/
lufa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Increased throughput of the USBtoSerial demo on systems that send multiple bytes...
[pub/lufa.git]
/
Projects
/
AVRISP-MKII
/
Lib
/
XPROG
/
XPROGTarget.c
diff --git
a/Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c
b/Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c
index
85a7504
..
3a74e15
100644
(file)
--- a/
Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c
+++ b/
Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c
@@
-53,12
+53,13
@@
volatile uint16_t SoftUSART_Data;
ISR(TIMER1_COMPA_vect, ISR_BLOCK)
\r
{
\r
/* Toggle CLOCK pin in a single cycle (see AVR datasheet) */
\r
ISR(TIMER1_COMPA_vect, ISR_BLOCK)
\r
{
\r
/* Toggle CLOCK pin in a single cycle (see AVR datasheet) */
\r
- BITBANG_PDICLOCK_PIN
|
= BITBANG_PDICLOCK_MASK;
\r
+ BITBANG_PDICLOCK_PIN = BITBANG_PDICLOCK_MASK;
\r
\r
/* If not sending or receiving, just exit */
\r
if (!(SoftUSART_BitCount))
\r
return;
\r
\r
\r
/* If not sending or receiving, just exit */
\r
if (!(SoftUSART_BitCount))
\r
return;
\r
\r
+ /* Check to see if we are at a rising or falling edge of the clock */
\r
if (BITBANG_PDICLOCK_PORT & BITBANG_PDICLOCK_MASK)
\r
{
\r
/* If at rising clock edge and we are in send mode, abort */
\r
if (BITBANG_PDICLOCK_PORT & BITBANG_PDICLOCK_MASK)
\r
{
\r
/* If at rising clock edge and we are in send mode, abort */
\r
@@
-102,7
+103,7
@@
ISR(TIMER1_COMPA_vect, ISR_BLOCK)
ISR(TIMER1_CAPT_vect, ISR_BLOCK)
\r
{
\r
/* Toggle CLOCK pin in a single cycle (see AVR datasheet) */
\r
ISR(TIMER1_CAPT_vect, ISR_BLOCK)
\r
{
\r
/* Toggle CLOCK pin in a single cycle (see AVR datasheet) */
\r
- BITBANG_TPICLOCK_PIN
|
= BITBANG_TPICLOCK_MASK;
\r
+ BITBANG_TPICLOCK_PIN = BITBANG_TPICLOCK_MASK;
\r
\r
/* If not sending or receiving, just exit */
\r
if (!(SoftUSART_BitCount))
\r
\r
/* If not sending or receiving, just exit */
\r
if (!(SoftUSART_BitCount))
\r
@@
-231,33
+232,23
@@
void XPROGTarget_DisableTargetPDI(void)
XPROGTarget_SetRxMode();
\r
\r
#if defined(XPROG_VIA_HARDWARE_USART)
\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
/* 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
UCSR1B = 0;
\r
UCSR1C = 0;
\r
\r
- /*
Set all USART lines as input, tristate
*/
\r
+ /*
Tristate all pins
*/
\r
DDRD &= ~((1 << 5) | (1 << 3));
\r
DDRD &= ~((1 << 5) | (1 << 3));
\r
- PORTD &= ~((1 <<
5) | (1 <<
3) | (1 << 2));
\r
+ PORTD &= ~((1 << 3) | (1 << 2));
\r
#else
\r
/* Turn off software USART management timer */
\r
TCCR1B = 0;
\r
\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
+ /* Tristate all pins */
\r
BITBANG_PDIDATA_DDR &= ~BITBANG_PDIDATA_MASK;
\r
BITBANG_PDICLOCK_DDR &= ~BITBANG_PDICLOCK_MASK;
\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_PDICLOCK_PORT &= ~BITBANG_PDICLOCK_MASK;
\r
+ BITBANG_PDIDATA_PORT &= ~BITBANG_PDIDATA_MASK;
\r
#endif
\r
}
\r
\r
#endif
\r
}
\r
\r