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).
This commit is contained in:
parent
9a1560dc05
commit
3d28d53c3e
11 changed files with 66 additions and 117 deletions
23
Projects/AVRISP-MKII/Lib/Timeout.S
Normal file
23
Projects/AVRISP-MKII/Lib/Timeout.S
Normal file
|
@ -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
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue