avr: added modules to n14 node.
This commit is contained in:
@@ -47,6 +47,7 @@
|
|||||||
#define MODULES_OWI_MASTER
|
#define MODULES_OWI_MASTER
|
||||||
#define MODULES_DS18B20
|
#define MODULES_DS18B20
|
||||||
#define MODULES_SK6812
|
#define MODULES_SK6812
|
||||||
|
#define MODULES_MOTION_LIGHT
|
||||||
|
|
||||||
; #define COM_ACCEPT_ALL_DEST
|
; #define COM_ACCEPT_ALL_DEST
|
||||||
|
|
||||||
@@ -66,7 +67,10 @@
|
|||||||
;.equ VALUE_ID_REED_CONF = 0x81
|
;.equ VALUE_ID_REED_CONF = 0x81
|
||||||
.equ VALUE_ID_LED_NUMLEDS = 0x82
|
.equ VALUE_ID_LED_NUMLEDS = 0x82
|
||||||
.equ VALUE_ID_LED_RGBW_VALUE = 0x83
|
.equ VALUE_ID_LED_RGBW_VALUE = 0x83
|
||||||
|
.equ VALUE_ID_MAL_RGBW_VALUE = 0x84
|
||||||
|
.equ VALUE_ID_MAL_ONTIME = 0x85
|
||||||
|
.equ VALUE_ID_MAL_SOURCE1 = 0x86
|
||||||
|
.equ VALUE_ID_MAL_SOURCE2 = 0x87
|
||||||
|
|
||||||
|
|
||||||
; ***************************************************************************
|
; ***************************************************************************
|
||||||
@@ -128,6 +132,16 @@ firmwareStart: rjmp main
|
|||||||
.include "modules/com2/defs.asm"
|
.include "modules/com2/defs.asm"
|
||||||
.include "modules/com2/main.asm"
|
.include "modules/com2/main.asm"
|
||||||
.include "modules/com2/buffer.asm"
|
.include "modules/com2/buffer.asm"
|
||||||
|
#ifdef MODULES_STATS
|
||||||
|
.include "modules/comproto/msg_recvstats.asm"
|
||||||
|
.include "modules/comproto/msg_sendstats.asm"
|
||||||
|
.include "modules/comproto/msg_sysstats.asm"
|
||||||
|
.include "modules/comproto/msg_memstats.asm"
|
||||||
|
#endif
|
||||||
|
.include "modules/comproto/msg_pong.asm"
|
||||||
|
.include "modules/comproto/msg_value.asm"
|
||||||
|
.include "modules/comproto/msg_device.asm"
|
||||||
|
.include "modules/comproto/msg_reboot.asm"
|
||||||
.include "modules/uart_bitbang/defs.asm"
|
.include "modules/uart_bitbang/defs.asm"
|
||||||
.include "modules/uart_bitbang/main.asm"
|
.include "modules/uart_bitbang/main.asm"
|
||||||
.include "modules/uart_bitbang/bytelevel.asm"
|
.include "modules/uart_bitbang/bytelevel.asm"
|
||||||
@@ -136,14 +150,6 @@ firmwareStart: rjmp main
|
|||||||
.include "modules/comproto/defs.asm"
|
.include "modules/comproto/defs.asm"
|
||||||
.include "modules/comproto/main.asm"
|
.include "modules/comproto/main.asm"
|
||||||
.include "modules/comproto/addr.asm"
|
.include "modules/comproto/addr.asm"
|
||||||
.include "modules/comproto/msg_recvstats.asm"
|
|
||||||
.include "modules/comproto/msg_sendstats.asm"
|
|
||||||
.include "modules/comproto/msg_sysstats.asm"
|
|
||||||
.include "modules/comproto/msg_memstats.asm"
|
|
||||||
.include "modules/comproto/msg_pong.asm"
|
|
||||||
.include "modules/comproto/msg_value.asm"
|
|
||||||
.include "modules/comproto/msg_device.asm"
|
|
||||||
.include "modules/comproto/msg_reboot.asm"
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#ifdef MODULES_STATS
|
#ifdef MODULES_STATS
|
||||||
@@ -158,7 +164,9 @@ firmwareStart: rjmp main
|
|||||||
#ifdef MODULES_SK6812
|
#ifdef MODULES_SK6812
|
||||||
.include "modules/sk6812/main.asm"
|
.include "modules/sk6812/main.asm"
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef MODULES_MOTION_LIGHT
|
||||||
|
.include "modules/ma_light/main.asm"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
; ***************************************************************************
|
; ***************************************************************************
|
||||||
@@ -271,6 +279,10 @@ onEvery100ms:
|
|||||||
rcall REED_Every100ms
|
rcall REED_Every100ms
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef MODULES_MOTION_LIGHT
|
||||||
|
rcall MotionLight_Every100ms
|
||||||
|
#endif
|
||||||
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
@@ -292,13 +304,22 @@ onPacketReceived:
|
|||||||
ld r16, x
|
ld r16, x
|
||||||
sbiw xh:xl, COM2_MSG_OFFS_CMD
|
sbiw xh:xl, COM2_MSG_OFFS_CMD
|
||||||
|
|
||||||
cpi r16, CPRO_CMD_VALUE_SET
|
#ifdef MODULES_MOTION_LIGHT
|
||||||
brne onPacketReceived_l1
|
rcall MotionLight_OnPacketReceived
|
||||||
; msg code is CPRO_CMD_VALUE_SET
|
brcs onPacketReceived_end
|
||||||
rjmp onSetValueReceived
|
#endif
|
||||||
|
|
||||||
onPacketReceived_l1:
|
#ifdef MODULES_COM
|
||||||
rjmp CPRO_OnPacketReceived
|
rcall CPRO_OnPacketReceived
|
||||||
|
brcs onPacketReceived_end
|
||||||
|
#endif
|
||||||
|
|
||||||
|
cpi r16, CPRO_CMD_VALUE_SET
|
||||||
|
clc
|
||||||
|
brne onPacketReceived_end
|
||||||
|
rjmp onSetValueReceived
|
||||||
|
onPacketReceived_end:
|
||||||
|
ret
|
||||||
; @end
|
; @end
|
||||||
|
|
||||||
|
|
||||||
@@ -321,6 +342,7 @@ onSetValueReceived_l2:
|
|||||||
ldi r16, CPRO_CMD_VALUE_SET_NACK
|
ldi r16, CPRO_CMD_VALUE_SET_NACK
|
||||||
rcall CPRO_SendSetValueResponse
|
rcall CPRO_SendSetValueResponse
|
||||||
clc
|
clc
|
||||||
|
onSetValueReceived_end:
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user