diff --git a/avr/devices/t03/test/main.asm b/avr/devices/t03/test/main.asm index ab5794a..1154fbb 100644 --- a/avr/devices/t03/test/main.asm +++ b/avr/devices/t03/test/main.asm @@ -57,6 +57,7 @@ #define MAIN_WITHOUT_MSG_HANDLING ; we do message handling ourselfes #define APP_STATS_NETDEV2 +#define APP_ROUTER_NO_ADDR_MGR #define MODULES_CLOCK ;#define MODULES_COM @@ -78,7 +79,8 @@ ;#define MODULES_COMONUART0 #define MODULES_TTYONUART1 #define APPS_STATS -#define APPS_NETWORK +;#define APPS_NETWORK +#define APPS_ROUTER @@ -95,6 +97,7 @@ .equ VALUE_ID_DS18B20_TEMP = 0x06 .equ VALUE_ID_LEDSIMPLE_TIMING = 0x88 +.equ VALUE_ID_ROUTER_SETRANGE = 0x89 @@ -184,13 +187,9 @@ firmwareStart: ; @routine onSystemStart onSystemStart: - ; set interface number for UART0 - ldi r16, COMONUART0_IFACENUM - sts netInterfaceData2+NET_IFACE_OFFS_IFACENUM, r16 - ; set interface number for UART1 - ldi r16, TTYONUART1_IFACENUM - sts ttyOnUart1_iface+NET_IFACE_OFFS_IFACENUM, r16 - + ldi r16, 0xf0 + sts netInterfaceData+NET_IFACE_OFFS_ADDRESS, r16 + sts netInterfaceData2+NET_IFACE_OFFS_ADDRESS, r16 ret ; @end @@ -211,7 +210,6 @@ onEveryDay: ; Called on every loop (i.e. after awakening from sleep). onEveryLoop: - rcall checkRecvdMsg ret ; @end @@ -229,113 +227,6 @@ onMessageReceived: -; --------------------------------------------------------------------------- -; @routine checkRecvdMsg -; -; Read messages from either interface and forward to the other one. - -checkRecvdMsg: - rcall NET_PeekNextIncomingMsgNum ; check read queue (bufNum->r16) - brcc checkRecvdMsg_end ; no msg, jmp - rcall NET_Buffer_Locate ; (R17) - ; let system handle incoming messages - push r16 - push xl - push xh - adiw xh:xl, 1 - rcall letSysHandleMsg - pop xh - pop xl - pop r16 - - ; forward to other interface - ld r17, X - andi r17, (1<