avr: started working on new SPI-like COM protocol.
use a clock and a data line to introduce synchronisation into the protocol to be able to work with the wide range of mcu speeds (no need for exact timing, no need for exact calibration).
This commit is contained in:
@@ -96,6 +96,21 @@
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifdef MODULES_COM2W
|
||||
.include "modules/com2w/defs.asm"
|
||||
.include "modules/com2w/com2w.asm"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifdef MODULES_COM2W1
|
||||
.include "modules/com2w/defs.asm"
|
||||
.include "modules/com2w/common.asm"
|
||||
.include "modules/com2w/com2w1.asm"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef MODULES_CLOCK
|
||||
.include "modules/clock/main.asm"
|
||||
#endif
|
||||
|
||||
@@ -135,6 +135,19 @@ onSystemTimerTick:
|
||||
bigcall ComOnUart1_Periodically
|
||||
#endif
|
||||
|
||||
#ifdef MODULES_COM2W
|
||||
bigcall COM2W_Every100ms
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef MODULES_COM2W0
|
||||
bigcall COM2W0_Periodically
|
||||
#endif
|
||||
|
||||
#ifdef MODULES_COM2W1
|
||||
bigcall COM2W1_Periodically
|
||||
#endif
|
||||
|
||||
#ifdef MODULES_TCRT1000
|
||||
bigcall TCRT1K_Every100ms
|
||||
#endif
|
||||
|
||||
@@ -81,6 +81,18 @@ initModules:
|
||||
bigcall ComOnUart1_Init
|
||||
#endif
|
||||
|
||||
#ifdef MODULES_COM2W
|
||||
bigcall COM2W_Init
|
||||
#endif
|
||||
|
||||
#ifdef MODULES_COM2W0
|
||||
bigcall COM2W0_Init
|
||||
#endif
|
||||
|
||||
#ifdef MODULES_COM2W1
|
||||
bigcall COM2W1_Init
|
||||
#endif
|
||||
|
||||
#ifdef MODULES_MOTION
|
||||
bigcall Motion_Init
|
||||
#endif
|
||||
@@ -223,6 +235,21 @@ runComModules_loop:
|
||||
pop r16
|
||||
sbci r16, 0
|
||||
#endif
|
||||
|
||||
#ifdef MODULES_COM2W0
|
||||
push r16
|
||||
bigcall COM2W0_Run
|
||||
pop r16
|
||||
sbci r16, 0
|
||||
#endif
|
||||
|
||||
#ifdef MODULES_COM2W1
|
||||
push r16
|
||||
bigcall COM2W1_Run
|
||||
pop r16
|
||||
sbci r16, 0
|
||||
#endif
|
||||
|
||||
pop r17
|
||||
; check for repeat request
|
||||
tst r16
|
||||
|
||||
Reference in New Issue
Block a user