aboutsummaryrefslogtreecommitdiffstats
path: root/Projects/AVRISP-MKII/Lib/Timeout.S
diff options
context:
space:
mode:
Diffstat (limited to 'Projects/AVRISP-MKII/Lib/Timeout.S')
-rw-r--r--Projects/AVRISP-MKII/Lib/Timeout.S23
1 files changed, 23 insertions, 0 deletions
diff --git a/Projects/AVRISP-MKII/Lib/Timeout.S b/Projects/AVRISP-MKII/Lib/Timeout.S
new file mode 100644
index 000000000..ad56d1d21
--- /dev/null
+++ b/Projects/AVRISP-MKII/Lib/Timeout.S
@@ -0,0 +1,23 @@
+#include <avr/io.h>
+#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