diff --git a/avr/apps/network/main.asm b/avr/apps/network/main.asm index 54c43b8..e7b5d8a 100644 --- a/avr/apps/network/main.asm +++ b/avr/apps/network/main.asm @@ -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 ; diff --git a/avr/devices/all/main.asm b/avr/devices/all/main.asm index 73c98fb..694afe7 100644 --- a/avr/devices/all/main.asm +++ b/avr/devices/all/main.asm @@ -168,6 +168,12 @@ sysOnEveryHour: sysOnEveryDay: +#ifdef APPS_NETWORK + ldi yl, LOW(netInterfaceData) + ldi yh, HIGH(netInterfaceData) + bigcall AppNetwork_EveryDay +#endif + bigjmp onEveryDay ; @end diff --git a/avr/modules/network/iface.asm b/avr/modules/network/iface.asm index 33c6434..06f9a20 100644 --- a/avr/modules/network/iface.asm +++ b/avr/modules/network/iface.asm @@ -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 + + +