n30: for code size reduction we don't use stats app. But we need to send DEVICE msg.
This commit is contained in:
@@ -45,6 +45,7 @@
|
||||
.equ NET_MSGNUMINBUF_SIZE = 8 ; max buffer nums in ringbuffer (global incoming)
|
||||
.equ NET_IFACE_OUTMSGBUF_SIZE = 8 ; max buffer nums in ringbuffer (per interface outbound)
|
||||
|
||||
.equ DEVICE_SEND_MINUTES = 3 ; send "DEVICE" message very 3 minutes
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
@@ -146,6 +147,8 @@ firmwareStart:
|
||||
; @routine onSystemStart
|
||||
|
||||
onSystemStart:
|
||||
ldi r16, DEVICE_SEND_MINUTES
|
||||
sts minuteCounter, r16
|
||||
ret
|
||||
; @end
|
||||
|
||||
@@ -169,12 +172,34 @@ onMessageReceived:
|
||||
; Called every 100ms. Add your routine calls here. No arguments, no results.
|
||||
|
||||
onEvery100ms:
|
||||
onEveryMinute:
|
||||
onEveryHour:
|
||||
onEveryDay:
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
onEveryMinute:
|
||||
lds r16, minuteCounter
|
||||
dec r16
|
||||
sts minuteCounter, r16
|
||||
brne onEveryMinute_end
|
||||
ldi r16, DEVICE_SEND_MINUTES
|
||||
sts minuteCounter, r16
|
||||
ldi yl, LOW(netInterfaceData)
|
||||
ldi yh, HIGH(netInterfaceData)
|
||||
rcall sendDevice
|
||||
#ifdef APP_STATS_NETDEV2
|
||||
ldi yl, LOW(netInterfaceData2)
|
||||
ldi yh, HIGH(netInterfaceData2)
|
||||
rcall sendDevice
|
||||
#endif
|
||||
onEveryMinute_end:
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
onEverySecond:
|
||||
ret
|
||||
#if 0
|
||||
@@ -200,6 +225,27 @@ onEveryLoop:
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine sendDevice
|
||||
|
||||
; @param Y network interface to work with
|
||||
; @clobbers R16, X (R17, R18, R19, R20, R21, Z)
|
||||
|
||||
sendDevice:
|
||||
bigcall NET_Buffer_Alloc ; (R16, R17, X)
|
||||
brcc sendDevice_end
|
||||
push r16
|
||||
adiw xh:xl, 1
|
||||
bigcall NETMSG_Device_Write ; (R16, R17, R18, R19, R20, R21, Z)
|
||||
sbiw xh:xl, 1
|
||||
pop r16
|
||||
bigcall NET_Interface_AddOrReleaseOutMsg ; (R16, R17, R18, X)
|
||||
sendDevice_end:
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
; ***************************************************************************
|
||||
@@ -208,6 +254,7 @@ onEveryLoop:
|
||||
.include "devices/all/hw_tn84.asm"
|
||||
.include "devices/all/includes.asm"
|
||||
;.include "common/debug.asm"
|
||||
.include "modules/network/msg/device-w.asm"
|
||||
|
||||
|
||||
|
||||
@@ -224,3 +271,8 @@ deviceCodeEnd:
|
||||
.endif
|
||||
|
||||
|
||||
|
||||
.dseg
|
||||
|
||||
minuteCounter: .byte 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user