aboutsummaryrefslogtreecommitdiffstats
path: root/Projects/AVRISP-MKII/Lib/V2Protocol.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-07-13 11:26:03 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-07-13 11:26:03 +0000
commit666c0fa4c31b2c9f7f02f6d0e09551e24dc4680c (patch)
tree6fd57a5b9cd741895fbaf55f6c56708d521d7748 /Projects/AVRISP-MKII/Lib/V2Protocol.c
parent03130342451003093e654edc5b031718d544e9ba (diff)
downloadlufa-666c0fa4c31b2c9f7f02f6d0e09551e24dc4680c.tar.gz
lufa-666c0fa4c31b2c9f7f02f6d0e09551e24dc4680c.tar.bz2
lufa-666c0fa4c31b2c9f7f02f6d0e09551e24dc4680c.zip
Remove the timeout period extension code from the AVRISP project, as no single command should ever exceed the maximum timeout period. Extend timeout period to 1 second per command, so that an accidental timeout will never occur.
Diffstat (limited to 'Projects/AVRISP-MKII/Lib/V2Protocol.c')
-rw-r--r--Projects/AVRISP-MKII/Lib/V2Protocol.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Projects/AVRISP-MKII/Lib/V2Protocol.c b/Projects/AVRISP-MKII/Lib/V2Protocol.c
index d6bb32a14..9e210c26a 100644
--- a/Projects/AVRISP-MKII/Lib/V2Protocol.c
+++ b/Projects/AVRISP-MKII/Lib/V2Protocol.c
@@ -46,8 +46,8 @@ bool MustLoadExtendedAddress;
/** ISR to manage timeouts whilst processing a V2Protocol command */
ISR(TIMER0_COMPA_vect, ISR_NOBLOCK)
{
- if (TimeoutMSRemaining)
- TimeoutMSRemaining--;
+ if (TimeoutTicksRemaining)
+ TimeoutTicksRemaining--;
}
/** Initializes the hardware and software associated with the V2 protocol command handling. */
@@ -60,8 +60,8 @@ void V2Protocol_Init(void)
ADC_StartReading(VTARGET_ADC_CHANNEL_MASK | ADC_RIGHT_ADJUSTED | ADC_REFERENCE_AVCC);
#endif
- /* Millisecond timer initialization for managing the command timeout counter */
- OCR0A = ((F_CPU / 64) / 1000);
+ /* Timeout timer initialization (10ms period) */
+ OCR0A = ((F_CPU / 1024) / 100);
TCCR0A = (1 << WGM01);
TIMSK0 = (1 << OCIE0A);
@@ -77,8 +77,8 @@ void V2Protocol_ProcessCommand(void)
uint8_t V2Command = Endpoint_Read_Byte();
/* Start the timeout management timer */
- TimeoutMSRemaining = COMMAND_TIMEOUT_MS;
- TCCR0B = ((1 << CS01) | (1 << CS00));
+ TimeoutTicksRemaining = COMMAND_TIMEOUT_TICKS;
+ TCCR0B = ((1 << CS02) | (1 << CS00));
switch (V2Command)
{