Timeout.S 308 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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