6 Commits

Author SHA1 Message Date
Martin Preuss
d7e4ee4cca fixed bugs on big systems. 2025-09-08 22:06:09 +02:00
Martin Preuss
5866a55067 use com2wi in S03 2025-09-08 22:05:52 +02:00
Martin Preuss
40282486f6 added com2wi2 (will become com2wi later). 2025-09-08 22:05:28 +02:00
Martin Preuss
2b2c41867f com2w: fixed a bug (on CRC error the buffer is not yet allocated). 2025-09-08 22:04:53 +02:00
Martin Preuss
679865f68b Fixed some bugs. 2025-09-08 22:04:15 +02:00
Martin Preuss
5b459ef5ac Merge branch 'mp-2025_07-improvr_uart_hw2' 2025-09-07 12:56:19 +02:00
10 changed files with 1156 additions and 26 deletions

View File

@@ -221,7 +221,7 @@ appNetworkHandlePingRequest_end:
appNetworkHandleReeunumRequest:
push xl
push xh
rcall Utils_ReadUid ; r21:r20:r19:r18=uid (r16, X)
bigcall Utils_ReadUid ; r21:r20:r19:r18=uid (r16, X)
pop xh
pop xl
rcall NETMSG_Range_Read ; r20=range begin, r21=range end (none)

View File

@@ -134,6 +134,12 @@
#ifdef MODULES_COM2WI
.include "modules/com2w/com2wi2.asm"
#endif
#ifdef MODULES_UARTFD0
.include "modules/uart_fd/defs.asm"
.include "modules/uart_fd/macros.asm"

View File

@@ -117,6 +117,10 @@ initModules:
bigcall COM2WN_Init
#endif
#ifdef MODULES_COM2WI
bigcall COM2WI_Init
#endif
#ifdef MODULES_MOTION
bigcall Motion_Init
@@ -281,6 +285,13 @@ runModules:
sbci r16, 0
#endif
#ifdef MODULES_COM2WI
push r16
bigcall COM2WI_Run
pop r16
sbci r16, 0
#endif
; add more modules here
; check for repeat request

View File

@@ -34,7 +34,8 @@
; generic
.equ NET_BUFFERS_NUM = 8
.equ NET_BUFFERS_SIZE = 32
.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)
@@ -60,9 +61,9 @@
;#define MODULES_UART_HW
#define MODULES_UART_BITBANG
#define MODULES_SPI_HW
#define MODULES_ILI9341
;#define MODULES_ILI9341
;#define MODULES_FONT_8X8
#define MODULES_FONT_6X8
;#define MODULES_FONT_6X8
;#define MODULES_UART_BITBANG
;#define MODULES_TWI_MASTER
;#define MODULES_LCD

View File

@@ -36,7 +36,8 @@
.equ STACK_SIZE = 256
.equ NET_BUFFERS_NUM = 8
.equ NET_BUFFERS_SIZE = 32
.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)

View File

@@ -97,6 +97,7 @@
#if 0
.equ COM_PORTS = 8
.equ COM_MASK_CLK0 = (1<<PINA0)
@@ -131,6 +132,11 @@
.equ COM_MASK_DATA7 = (1<<PINC7)
.equ COM_MASK_IRQ7 = (1<<PCINT7)
#else
.equ COM_MASK_CLK0 = (1<<PINA6)
.equ COM_MASK_DATA0 = (1<<PINC6)
.equ COM_MASK_IRQ0 = (1<<PCINT6)
#endif

View File

@@ -36,15 +36,14 @@
.equ NET_BUFFERS_NUM = 96
.equ NET_MSGNUMINBUF_SIZE = 64 ; max buffer nums in ringbuffer (global incoming)
.equ NET_IFACE_OUTMSGBUF_SIZE = 16 ; max buffer nums in ringbuffer (per interface outbound)
.equ COM2WN_IO_RINGBUFFER_SIZE = 240
; ---------------------------------------------------------------------------
; firmware settings including list of modules used
#define MAIN_WITHOUT_MSG_HANDLING ; message handling done here
#define APP_STATS_NETDEV2
;#define MAIN_WITHOUT_MSG_HANDLING ; message handling done here
;#define APP_STATS_NETDEV2
#define COM_ACCEPT_ALL_DEST ; accept all messages!
; #define MODULES_TIMER
@@ -54,7 +53,7 @@
#define MODULES_LED_SIMPLE
#define MODULES_LED_ACTIVITY
#define MODULES_NETWORK
#define MODULES_COM2WN
#define MODULES_COM2WI
;#define MODULES_COMONUART0
;#define MODULES_UART_HW
;#define MODULES_UART_BITBANG
@@ -74,11 +73,11 @@
;#define MODULES_MOTION
;#define MODULES_CCS811
;#define APPS_NETWORK
#define APPS_NETWORK
;#define APPS_MOTION
;#define APPS_REPORTSENSORS
#define APPS_STATS
#define APPS_HUB
;#define APPS_HUB
@@ -116,7 +115,7 @@
jmp irqNotSet ; 2: INT0 External Interrupt Request 0
jmp irqNotSet ; 3: INT1 External Interrupt Request 1
jmp irqNotSet ; 4: INT2 External Interrupt Request 2
jmp COM2WN_ClkChangeIsr ; 5: PCINT0 Pin Change Interrupt Request 0
jmp irqNotSet ; 5: PCINT0 Pin Change Interrupt Request 0
jmp irqNotSet ; 6: PCINT1 Pin Change Interrupt Request 1
jmp irqNotSet ; 7: PCINT2 Pin Change Interrupt Request 2
jmp irqNotSet ; 8: PCINT3 Pin Change Interrupt Request 3
@@ -125,7 +124,7 @@
jmp irqNotSet ; 11: TIMER2_COMPB Timer/Counter2 Compare Match B
jmp irqNotSet ; 12: TIMER2_OVF Timer/Counter2 Overflow
jmp irqNotSet ; 13: TIMER1_CAPT Timer/Counter1 Capture Event
jmp irqNotSet ; 14: TIMER1_COMPA Timer/Counter1 Compare Match A
jmp COM2WI_Timer1Isr ; 14: TIMER1_COMPA Timer/Counter1 Compare Match A
jmp irqNotSet ; 15: TIMER1_COMPB Timer/Counter1 Compare Match B
jmp irqNotSet ; 16: TIMER1_OVF Timer/Counter1 Overflow
jmp baseTimerIrqOC0A ; 17: TIMER0_COMPA Timer/Counter0 Compare Match A
@@ -169,6 +168,7 @@ irqNotSet:
; @routine onSystemStart
onSystemStart:
; rcall LedActivity_Trigger
ret
; @end
@@ -240,8 +240,8 @@ onEveryLoop:
;.equ netInterfaceData = netUartIface
;.equ netInterfaceData = uart_bitbang_iface
.equ netInterfaceData = com2w6_iface
.equ netInterfaceData2 = com2w5_iface
.equ netInterfaceData = com2wi0_iface
;.equ netInterfaceData2 = com2w5_iface

View File

@@ -188,9 +188,9 @@ com2wReceiveNextPkg:
ldi r16, NET_IFACE_OFFS_PACKETSIN_LOW
rcall NET_Interface_IncCounter16 ; (R24, R25)
rjmp com2wReceiveNextPkg_end
com2wReceiveNextPkg_forMe:
#endif
com2wReceiveNextPkg_forMe:
; msg received, alloc buffer for it
rcall NET_Buffer_Alloc ; R16=buffer num (R16, R17, X)
brcs com2wReceiveNextPkg_gotBuffer
@@ -232,11 +232,9 @@ com2wReceiveNextPkg_copyLoop:
#endif
rjmp com2wReceiveNextPkg_end
com2wReceiveNextPkg_eCrc:
push r16
ldi r16, NET_IFACE_OFFS_ERR_CONTENT_LOW
rcall NET_Interface_IncCounter16 ; (R24, R25)
pop r16
rjmp com2wReceiveNextPkg_relBuffer
ldi r16, NET_IFACE_OFFS_ERR_CONTENT_LOW
rcall NET_Interface_IncCounter16 ; (R24, R25)
rjmp com2wReceiveNextPkg_end
com2wReceiveNextPkg_eMissed:
push r16
ldi r16, NET_IFACE_OFFS_ERR_MISSED_LOW

File diff suppressed because it is too large Load Diff

View File

@@ -25,8 +25,8 @@ OBJ_Init:
mov xh, yh
clr r16
ldi r17, OBJ_OFFS_SIZE
rcall Utils_FillSram ; (R17, X)
rcall Tree_InitObject ; (R16)
bigcall Utils_FillSram ; (R17, X)
bigcall Tree_InitObject ; (R16)
pop r17
std Y+OBJ_OFFS_OPTIONS, r17
ldi r16, LOW(OBJ_DefaultHandler)
@@ -480,7 +480,7 @@ objFreeTimers:
OBJ_Link_new:
ldi r24, LOW(OBJ_LINK_SIZE)
ldi r25, HIGH(OBJ_LINK_SIZE)
rcall Heap_Alloc
bigcall Heap_Alloc
brcc OBJ_Link_new_end
mov yl, xl
mov yh, xh
@@ -522,7 +522,7 @@ OBJ_Link_free:
OBJ_Timer_new:
ldi r24, LOW(TIMER_SIZE)
ldi r25, HIGH(TIMER_SIZE)
rcall Heap_Alloc
bigcall Heap_Alloc
brcc OBJ_Timer_new_end
mov yl, xl
mov yh, xh
@@ -547,7 +547,7 @@ OBJ_Timer_free:
rcall List_FiniObject ; (R16)
mov xl, yl
mov xh, yh
rcall Heap_free ; (r16, r17, r24, r25, X)
bigcall Heap_free ; (r16, r17, r24, r25, X)
clc
ret
; @end