avr: added NET_Interface_ResetStats and call it daily.

This commit is contained in:
Martin Preuss
2025-06-16 23:28:52 +02:00
parent 0ce70e48b1
commit a89b875872
3 changed files with 37 additions and 0 deletions

View File

@@ -100,6 +100,17 @@ AppNetwork_Every100ms_jump:
; ---------------------------------------------------------------------------
; @routine AppNetwork_Every100ms @global
;
; @clobbers R16, R17, X
AppNetwork_EveryDay:
bigjmp NET_Interface_ResetStats ; (R16, R17, X)
; @end
; ---------------------------------------------------------------------------
; @routine AppNetwork_HandleMsg @global
;

View File

@@ -168,6 +168,12 @@ sysOnEveryHour:
sysOnEveryDay:
#ifdef APPS_NETWORK
ldi yl, LOW(netInterfaceData)
ldi yh, HIGH(netInterfaceData)
bigcall AppNetwork_EveryDay
#endif
bigjmp onEveryDay
; @end

View File

@@ -220,4 +220,24 @@ NET_Interface_Periodically_l2:
; ---------------------------------------------------------------------------
; @routine NET_Interface_ResetStats @global
;
; @param Y pointer to start of interface data
; @clobbers R16, R17, X
NET_Interface_ResetStats:
clr r16
std Y+NET_IFACE_OFFS_PACKETSIN_LOW, r16
mov xl, yl
mov xh, yh
adiw xh:xl, NET_IFACE_OFFS_PACKETSIN_LOW
ldi r17, ((NET_IFACE_OFFS_ERR_BUSY_HIGH+1)-NET_IFACE_OFFS_PACKETSIN_LOW)
clr r16
rjmp Utils_FillSram ; (R17, X)
; @end