diff options
author | Dean Camera <[email protected]> | 2009-12-26 04:13:55 +0000 |
---|---|---|
committer | Dean Camera <[email protected]> | 2009-12-26 04:13:55 +0000 |
commit | d1608d4af321529f0ddef9defcd97669ae9018c3 (patch) | |
tree | 79a2ba0fe2bfa14670a489e77f4c201f380de4f0 /Projects/AVRISP/Lib/ISP/ISPProtocol.h | |
parent | 35dac470f243d234d72f34cbaeb1d6c8a15bc435 (diff) | |
download | qmk_firmware-d1608d4af321529f0ddef9defcd97669ae9018c3.tar.gz qmk_firmware-d1608d4af321529f0ddef9defcd97669ae9018c3.zip |
Added const where possible to the source functions in the Projects directory.
Added command timeout to the AVRISP project so that incorrectly connected targets no longer freeze the device.
Removed string descriptors from the TeensyHID bootloader to reduce its size.
Diffstat (limited to 'Projects/AVRISP/Lib/ISP/ISPProtocol.h')
-rw-r--r-- | Projects/AVRISP/Lib/ISP/ISPProtocol.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Projects/AVRISP/Lib/ISP/ISPProtocol.h b/Projects/AVRISP/Lib/ISP/ISPProtocol.h index 43c25c4fa3..abbbf569d6 100644 --- a/Projects/AVRISP/Lib/ISP/ISPProtocol.h +++ b/Projects/AVRISP/Lib/ISP/ISPProtocol.h @@ -72,17 +72,20 @@ */
static inline void ISPProtocol_DelayMS(uint8_t DelayMS)
{
- TCNT0 = 0;
- TIFR0 = (1 << OCF1A);
+ OCR2A = ((F_CPU / 64) / 1000);
+ TCCR2A = (1 << WGM01);
+ TCCR2B = ((1 << CS01) | (1 << CS00));
while (DelayMS)
{
- if (TIFR0 & (1 << OCF1A))
+ if (TIFR2 & (1 << OCF2A))
{
- TIFR0 = (1 << OCF1A);
+ TIFR2 = (1 << OCF2A);
DelayMS--;
}
}
+
+ TCCR2B = 0;
}
/* Function Prototypes: */
|