From 3d28d53c3e2ae529933283e63a8b05f2ab1ce2be Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sun, 2 May 2010 05:16:34 +0000 Subject: Change AVRISP project's timeout to be interrupt based again, but make the interrupt itself interruptable and use a seperate assembly file to hand-optimize the ISR code. Removed the cast to uint16_t on the set baud rate in the USBtoSerial project, so that the higher >1M baud rates can be selected (thanks to Steffan). --- Projects/AVRISP-MKII/Lib/Timeout.S | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Projects/AVRISP-MKII/Lib/Timeout.S (limited to 'Projects/AVRISP-MKII/Lib/Timeout.S') diff --git a/Projects/AVRISP-MKII/Lib/Timeout.S b/Projects/AVRISP-MKII/Lib/Timeout.S new file mode 100644 index 0000000000..ad56d1d215 --- /dev/null +++ b/Projects/AVRISP-MKII/Lib/Timeout.S @@ -0,0 +1,23 @@ +#include +#include "V2Protocol.h" + +.global TIMER0_COMPA_vect +TIMER0_COMPA_vect: + sei + push r24 + in r24, 0x3f + push r24 + + in r24, TimeoutMSRemaining + and r24, r24 + breq Epilogue + subi r24, 0x01 + out TimeoutMSRemaining, r24 + +Epilogue: + pop r24 + out 0x3f, r24 + pop r24 + reti + + \ No newline at end of file -- cgit v1.2.3