avr: guard with precompiler directives.

This commit is contained in:
Martin Preuss
2026-04-26 12:47:50 +02:00
parent 240624c727
commit 74e471ef28
25 changed files with 160 additions and 36 deletions

View File

@@ -7,6 +7,10 @@
; * Please see toplevel file COPYING of that project for license details. * ; * Please see toplevel file COPYING of that project for license details. *
; *************************************************************************** ; ***************************************************************************
#ifndef AQH_AVR_NETWORK_BUFFER_ASM
#define AQH_AVR_NETWORK_BUFFER_ASM
; =========================================================================== ; ===========================================================================
; defs ; defs
@@ -260,3 +264,6 @@ NET_Buffer_CountUsed:
; @end ; @end
#endif

View File

@@ -1,5 +1,5 @@
; *************************************************************************** ; ***************************************************************************
; copyright : (C) 2025 by Martin Preuss ; copyright : (C) 2026 by Martin Preuss
; email : martin@libchipcard.de ; email : martin@libchipcard.de
; ;
; *************************************************************************** ; ***************************************************************************
@@ -7,6 +7,9 @@
; * Please see toplevel file COPYING of that project for license details. * ; * Please see toplevel file COPYING of that project for license details. *
; *************************************************************************** ; ***************************************************************************
#ifndef AQH_AVR_NETWORK_DATA_ASM
#define AQH_AVR_NETWORK_DATA_ASM
.dseg .dseg
@@ -21,3 +24,7 @@ networkDataBegin:
networkDataEnd: networkDataEnd:
#endif

View File

@@ -1,5 +1,5 @@
; *************************************************************************** ; ***************************************************************************
; copyright : (C) 2025 by Martin Preuss ; copyright : (C) 2026 by Martin Preuss
; email : martin@libchipcard.de ; email : martin@libchipcard.de
; ;
; *************************************************************************** ; ***************************************************************************
@@ -7,14 +7,14 @@
; * Please see toplevel file COPYING of that project for license details. * ; * Please see toplevel file COPYING of that project for license details. *
; *************************************************************************** ; ***************************************************************************
#ifndef AQH_AVR_NETWORK_DEFS_ASM
#define AQH_AVR_NETWORK_DEFS_ASM
; defs ; defs
.equ NET_BUFFERS_SIZE = 28 ; CAVE: need to adapt routine NET_Buffer_Locate when changing this value!! .equ NET_BUFFERS_SIZE = 28 ; CAVEAT: need to adapt routine NET_Buffer_Locate when changing this value!!
;.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 NET_IFACE_BUFFER_INUSE_BIT3 = 7 .equ NET_IFACE_BUFFER_INUSE_BIT3 = 7
.equ NET_IFACE_BUFFER_INUSE_BIT2 = 6 .equ NET_IFACE_BUFFER_INUSE_BIT2 = 6
@@ -64,4 +64,5 @@
#endif

View File

@@ -1,5 +1,5 @@
; *************************************************************************** ; ***************************************************************************
; copyright : (C) 2025 by Martin Preuss ; copyright : (C) 2026 by Martin Preuss
; email : martin@libchipcard.de ; email : martin@libchipcard.de
; ;
; *************************************************************************** ; ***************************************************************************
@@ -7,6 +7,9 @@
; * Please see toplevel file COPYING of that project for license details. * ; * Please see toplevel file COPYING of that project for license details. *
; *************************************************************************** ; ***************************************************************************
#ifndef AQH_AVR_NETWORK_IFACE_ASM
#define AQH_AVR_NETWORK_IFACE_ASM
.cseg .cseg
@@ -251,4 +254,5 @@ NET_Interface_ResetStats:
#endif

View File

@@ -7,6 +7,9 @@
; * Please see toplevel file COPYING of that project for license details. * ; * Please see toplevel file COPYING of that project for license details. *
; *************************************************************************** ; ***************************************************************************
#ifndef AQH_AVR_NETWORK_MAIN_ASM
#define AQH_AVR_NETWORK_MAIN_ASM
.cseg .cseg
@@ -20,14 +23,6 @@
; @clobbers R16, R17, X ; @clobbers R16, R17, X
NET_Init: NET_Init:
#if 0
ldi xh, HIGH(networkDataBegin)
ldi xl, LOW(networkDataBegin)
clr r16
ldi r17, (networkDataEnd-networkDataBegin)
rcall Utils_FillSram ; (R17, X)
#endif
rcall NET_Buffer_Init ; (R16, R17, X) rcall NET_Buffer_Init ; (R16, R17, X)
ldi r16, NET_MSGNUMINBUF_SIZE ldi r16, NET_MSGNUMINBUF_SIZE
@@ -102,3 +97,6 @@ NET_PeekNextIncomingMsgNum:
#endif

View File

@@ -1,5 +1,5 @@
; *************************************************************************** ; ***************************************************************************
; copyright : (C) 2025 by Martin Preuss ; copyright : (C) 2026 by Martin Preuss
; email : martin@libchipcard.de ; email : martin@libchipcard.de
; ;
; *************************************************************************** ; ***************************************************************************
@@ -7,8 +7,14 @@
; * Please see toplevel file COPYING of that project for license details. * ; * Please see toplevel file COPYING of that project for license details. *
; *************************************************************************** ; ***************************************************************************
#ifndef AQH_AVR_NETWORK_MSG_ADDR_D_ASM
#define AQH_AVR_NETWORK_MSG_ADDR_D_ASM
.equ NETMSG_ADDRESS_OFFS_UID = 4 .equ NETMSG_ADDRESS_OFFS_UID = 4
.equ NETMSG_ADDRESS_OFFS_ADDRESS = 8 .equ NETMSG_ADDRESS_OFFS_ADDRESS = 8
#endif

View File

@@ -1,5 +1,5 @@
; *************************************************************************** ; ***************************************************************************
; copyright : (C) 2025 by Martin Preuss ; copyright : (C) 2026 by Martin Preuss
; email : martin@libchipcard.de ; email : martin@libchipcard.de
; ;
; *************************************************************************** ; ***************************************************************************
@@ -7,6 +7,10 @@
; * Please see toplevel file COPYING of that project for license details. * ; * Please see toplevel file COPYING of that project for license details. *
; *************************************************************************** ; ***************************************************************************
#ifndef AQH_AVR_NETWORK_MSG_ADDR_R_ASM
#define AQH_AVR_NETWORK_MSG_ADDR_R_ASM
; *************************************************************************** ; ***************************************************************************
; code ; code
@@ -15,8 +19,8 @@
; --------------------------------------------------------------------------- ; ---------------------------------------------------------------------------
; @routine NETMSG_ValueRead @global ; @routine NETMSG_Address_Read @global
; Read a VALUE message. ; Read an ADDRESS message.
; ;
; @param X buffer to read from ; @param X buffer to read from
; @return R18 command ; @return R18 command
@@ -24,7 +28,7 @@
; @clobbers R18, R19 ; @clobbers R18, R19
NETMSG_Address_Read: NETMSG_Address_Read:
adiw xh:xl, 2 adiw xh:xl, NETMSG_OFFS_CMD
ld r18, X+ ; command ld r18, X+ ; command
adiw xh:xl, 5 ; skip src addr and uid adiw xh:xl, 5 ; skip src addr and uid
ld r19, X+ ; addr ld r19, X+ ; addr
@@ -34,3 +38,5 @@ NETMSG_Address_Read:
#endif

View File

@@ -1,5 +1,5 @@
; *************************************************************************** ; ***************************************************************************
; copyright : (C) 2025 by Martin Preuss ; copyright : (C) 2026 by Martin Preuss
; email : martin@libchipcard.de ; email : martin@libchipcard.de
; ;
; *************************************************************************** ; ***************************************************************************
@@ -7,6 +7,9 @@
; * Please see toplevel file COPYING of that project for license details. * ; * Please see toplevel file COPYING of that project for license details. *
; *************************************************************************** ; ***************************************************************************
#ifndef AQH_AVR_NETWORK_MSG_ADDR_W_ASM
#define AQH_AVR_NETWORK_MSG_ADDR_W_ASM
; --------------------------------------------------------------------------- ; ---------------------------------------------------------------------------
; @routine NETMSG_Address_Write ; @routine NETMSG_Address_Write
@@ -37,3 +40,5 @@ NETMSG_Address_Write:
#endif

View File

@@ -7,6 +7,9 @@
; * Please see toplevel file COPYING of that project for license details. * ; * Please see toplevel file COPYING of that project for license details. *
; *************************************************************************** ; ***************************************************************************
#ifndef AQH_AVR_NETWORK_MSG_COMMON_ASM
#define AQH_AVR_NETWORK_MSG_COMMON_ASM
; ;
; --------------------------------------------------------------------------- ; ---------------------------------------------------------------------------
; @routine NETMSG_Common_AddUidToBuffer @global ; @routine NETMSG_Common_AddUidToBuffer @global
@@ -92,3 +95,5 @@ NETMSG_CheckUidInMsg_notMe:
#endif

View File

@@ -1,5 +1,5 @@
; *************************************************************************** ; ***************************************************************************
; copyright : (C) 2025 by Martin Preuss ; copyright : (C) 2026 by Martin Preuss
; email : martin@libchipcard.de ; email : martin@libchipcard.de
; ;
; *************************************************************************** ; ***************************************************************************
@@ -7,6 +7,9 @@
; * Please see toplevel file COPYING of that project for license details. * ; * Please see toplevel file COPYING of that project for license details. *
; *************************************************************************** ; ***************************************************************************
#ifndef AQH_AVR_NETWORK_MSG_CRC_ASM
#define AQH_AVR_NETWORK_MSG_CRC_ASM
; --------------------------------------------------------------------------- ; ---------------------------------------------------------------------------
@@ -101,3 +104,6 @@ netMsgCrcCalc_l1:
; @end ; @end
#endif

View File

@@ -7,6 +7,9 @@
; * Please see toplevel file COPYING of that project for license details. * ; * Please see toplevel file COPYING of that project for license details. *
; *************************************************************************** ; ***************************************************************************
#ifndef AQH_AVR_NETWORK_MSG_DEBUG_ASM
#define AQH_AVR_NETWORK_MSG_DEBUG_ASM
; --------------------------------------------------------------------------- ; ---------------------------------------------------------------------------
@@ -90,3 +93,5 @@ NETMSG_Debug_Write2_loop:
#endif

View File

@@ -1,5 +1,5 @@
; *************************************************************************** ; ***************************************************************************
; copyright : (C) 2025 by Martin Preuss ; copyright : (C) 2026 by Martin Preuss
; email : martin@libchipcard.de ; email : martin@libchipcard.de
; ;
; *************************************************************************** ; ***************************************************************************
@@ -7,6 +7,9 @@
; * Please see toplevel file COPYING of that project for license details. * ; * Please see toplevel file COPYING of that project for license details. *
; *************************************************************************** ; ***************************************************************************
#ifndef AQH_AVR_NETWORK_MSG_DEFS_ASM
#define AQH_AVR_NETWORK_MSG_DEFS_ASM
; --------------------------------------------------------------------------- ; ---------------------------------------------------------------------------
@@ -75,3 +78,6 @@
#endif

View File

@@ -1,5 +1,5 @@
; *************************************************************************** ; ***************************************************************************
; copyright : (C) 2025 by Martin Preuss ; copyright : (C) 2026 by Martin Preuss
; email : martin@libchipcard.de ; email : martin@libchipcard.de
; ;
; *************************************************************************** ; ***************************************************************************
@@ -7,6 +7,9 @@
; * Please see toplevel file COPYING of that project for license details. * ; * Please see toplevel file COPYING of that project for license details. *
; *************************************************************************** ; ***************************************************************************
#ifndef AQH_AVR_NETWORK_MSG_DEVICE_W_ASM
#define AQH_AVR_NETWORK_MSG_DEVICE_W_ASM
; --------------------------------------------------------------------------- ; ---------------------------------------------------------------------------
@@ -38,3 +41,5 @@ NETMSG_Device_Write:
#endif

View File

@@ -1,5 +1,5 @@
; *************************************************************************** ; ***************************************************************************
; copyright : (C) 2025 by Martin Preuss ; copyright : (C) 2026 by Martin Preuss
; email : martin@libchipcard.de ; email : martin@libchipcard.de
; ;
; *************************************************************************** ; ***************************************************************************
@@ -7,6 +7,9 @@
; * Please see toplevel file COPYING of that project for license details. * ; * Please see toplevel file COPYING of that project for license details. *
; *************************************************************************** ; ***************************************************************************
#ifndef AQH_AVR_NETWORK_MSG_PONG_W_ASM
#define AQH_AVR_NETWORK_MSG_PONG_W_ASM
; --------------------------------------------------------------------------- ; ---------------------------------------------------------------------------
@@ -35,3 +38,5 @@ NETMSG_Pong_Write:
#endif

View File

@@ -1,5 +1,5 @@
; *************************************************************************** ; ***************************************************************************
; copyright : (C) 2025 by Martin Preuss ; copyright : (C) 2026 by Martin Preuss
; email : martin@libchipcard.de ; email : martin@libchipcard.de
; ;
; *************************************************************************** ; ***************************************************************************
@@ -7,6 +7,8 @@
; * Please see toplevel file COPYING of that project for license details. * ; * Please see toplevel file COPYING of that project for license details. *
; *************************************************************************** ; ***************************************************************************
#ifndef AQH_AVR_NETWORK_MSG_RANGE_D_ASM
#define AQH_AVR_NETWORK_MSG_RANGE_D_ASM
.equ NETMSG_RANGE_OFFS_UID = 4 .equ NETMSG_RANGE_OFFS_UID = 4
@@ -15,4 +17,5 @@
#endif

View File

@@ -1,5 +1,5 @@
; *************************************************************************** ; ***************************************************************************
; copyright : (C) 2025 by Martin Preuss ; copyright : (C) 2026 by Martin Preuss
; email : martin@libchipcard.de ; email : martin@libchipcard.de
; ;
; *************************************************************************** ; ***************************************************************************
@@ -7,6 +7,9 @@
; * Please see toplevel file COPYING of that project for license details. * ; * Please see toplevel file COPYING of that project for license details. *
; *************************************************************************** ; ***************************************************************************
#ifndef AQH_AVR_NETWORK_MSG_RANGE_R_ASM
#define AQH_AVR_NETWORK_MSG_RANGE_R_ASM
; *************************************************************************** ; ***************************************************************************
; code ; code
@@ -36,3 +39,5 @@ NETMSG_Range_Read:
#endif

View File

@@ -7,6 +7,9 @@
; * Please see toplevel file COPYING of that project for license details. * ; * Please see toplevel file COPYING of that project for license details. *
; *************************************************************************** ; ***************************************************************************
#ifndef AQH_AVR_NETWORK_MSG_RANGE_W_ASM
#define AQH_AVR_NETWORK_MSG_RANGE_W_ASM
; --------------------------------------------------------------------------- ; ---------------------------------------------------------------------------
; @routine NETMSG_Range_Write ; @routine NETMSG_Range_Write
@@ -42,3 +45,5 @@ NETMSG_Range_Write:
#endif

View File

@@ -1,5 +1,5 @@
; *************************************************************************** ; ***************************************************************************
; copyright : (C) 2025 by Martin Preuss ; copyright : (C) 2026 by Martin Preuss
; email : martin@libchipcard.de ; email : martin@libchipcard.de
; ;
; *************************************************************************** ; ***************************************************************************
@@ -7,8 +7,13 @@
; * Please see toplevel file COPYING of that project for license details. * ; * Please see toplevel file COPYING of that project for license details. *
; *************************************************************************** ; ***************************************************************************
#ifndef AQH_AVR_NETWORK_MSG_REBOOT_D_ASM
#define AQH_AVR_NETWORK_MSG_REBOOT_D_ASM
.equ NETMSG_REBOOTREQ_OFFS_UID = 4 .equ NETMSG_REBOOTREQ_OFFS_UID = 4
#endif

View File

@@ -1,5 +1,5 @@
; *************************************************************************** ; ***************************************************************************
; copyright : (C) 2025 by Martin Preuss ; copyright : (C) 2026 by Martin Preuss
; email : martin@libchipcard.de ; email : martin@libchipcard.de
; ;
; *************************************************************************** ; ***************************************************************************
@@ -7,6 +7,9 @@
; * Please see toplevel file COPYING of that project for license details. * ; * Please see toplevel file COPYING of that project for license details. *
; *************************************************************************** ; ***************************************************************************
#ifndef AQH_AVR_NETWORK_MSG_REBOOT_R_ASM
#define AQH_AVR_NETWORK_MSG_REBOOT_R_ASM
; *************************************************************************** ; ***************************************************************************
; code ; code
@@ -39,3 +42,5 @@ NETMSG_RebootRequestRead:
; @end ; @end
#endif

View File

@@ -1,5 +1,5 @@
; *************************************************************************** ; ***************************************************************************
; copyright : (C) 2025 by Martin Preuss ; copyright : (C) 2026 by Martin Preuss
; email : martin@libchipcard.de ; email : martin@libchipcard.de
; ;
; *************************************************************************** ; ***************************************************************************
@@ -7,6 +7,9 @@
; * Please see toplevel file COPYING of that project for license details. * ; * Please see toplevel file COPYING of that project for license details. *
; *************************************************************************** ; ***************************************************************************
#ifndef AQH_AVR_NETWORK_MSG_RECVSTATS_W_ASM
#define AQH_AVR_NETWORK_MSG_RECVSTATS_W_ASM
; --------------------------------------------------------------------------- ; ---------------------------------------------------------------------------
@@ -70,3 +73,6 @@ NETMSG_RecvStats_Write:
#endif

View File

@@ -1,5 +1,5 @@
; *************************************************************************** ; ***************************************************************************
; copyright : (C) 2025 by Martin Preuss ; copyright : (C) 2026 by Martin Preuss
; email : martin@libchipcard.de ; email : martin@libchipcard.de
; ;
; *************************************************************************** ; ***************************************************************************
@@ -7,6 +7,9 @@
; * Please see toplevel file COPYING of that project for license details. * ; * Please see toplevel file COPYING of that project for license details. *
; *************************************************************************** ; ***************************************************************************
#ifndef AQH_AVR_NETWORK_MSG_SENDSTATS_W_ASM
#define AQH_AVR_NETWORK_MSG_SENDSTATS_W_ASM
; --------------------------------------------------------------------------- ; ---------------------------------------------------------------------------
@@ -55,3 +58,5 @@ NETMSG_SendStats_Write:
#endif

View File

@@ -1,5 +1,5 @@
; *************************************************************************** ; ***************************************************************************
; copyright : (C) 2025 by Martin Preuss ; copyright : (C) 2026 by Martin Preuss
; email : martin@libchipcard.de ; email : martin@libchipcard.de
; ;
; *************************************************************************** ; ***************************************************************************
@@ -7,6 +7,10 @@
; * Please see toplevel file COPYING of that project for license details. * ; * Please see toplevel file COPYING of that project for license details. *
; *************************************************************************** ; ***************************************************************************
#ifndef AQH_AVR_NETWORK_MSG_SIMPLEMSG_W_ASM
#define AQH_AVR_NETWORK_MSG_SIMPLEMSG_W_ASM
; *************************************************************************** ; ***************************************************************************
; code ; code
@@ -40,3 +44,6 @@ NETMSG_SimpleMsgWrite:
; @end ; @end
#endif

View File

@@ -1,5 +1,5 @@
; *************************************************************************** ; ***************************************************************************
; copyright : (C) 2025 by Martin Preuss ; copyright : (C) 2026 by Martin Preuss
; email : martin@libchipcard.de ; email : martin@libchipcard.de
; ;
; *************************************************************************** ; ***************************************************************************
@@ -7,6 +7,9 @@
; * Please see toplevel file COPYING of that project for license details. * ; * Please see toplevel file COPYING of that project for license details. *
; *************************************************************************** ; ***************************************************************************
#ifndef AQH_AVR_NETWORK_MSG_VALUE_D_ASM
#define AQH_AVR_NETWORK_MSG_VALUE_D_ASM
.equ NETMSG_VALUE_OFFS_UID = 4 .equ NETMSG_VALUE_OFFS_UID = 4
.equ NETMSG_VALUE_OFFS_MSGID = 8 .equ NETMSG_VALUE_OFFS_MSGID = 8
@@ -14,3 +17,6 @@
.equ NETMSG_VALUE_OFFS_VALUE = 12 .equ NETMSG_VALUE_OFFS_VALUE = 12
.equ NETMSG_VALUE_OFFS_DENOM = 14 .equ NETMSG_VALUE_OFFS_DENOM = 14
#endif

View File

@@ -1,5 +1,5 @@
; *************************************************************************** ; ***************************************************************************
; copyright : (C) 2025 by Martin Preuss ; copyright : (C) 2026 by Martin Preuss
; email : martin@libchipcard.de ; email : martin@libchipcard.de
; ;
; *************************************************************************** ; ***************************************************************************
@@ -7,6 +7,9 @@
; * Please see toplevel file COPYING of that project for license details. * ; * Please see toplevel file COPYING of that project for license details. *
; *************************************************************************** ; ***************************************************************************
#ifndef AQH_AVR_NETWORK_MSG_VALUE_R_ASM
#define AQH_AVR_NETWORK_MSG_VALUE_R_ASM
; *************************************************************************** ; ***************************************************************************
; code ; code
@@ -44,3 +47,6 @@ NETMSG_ValueRead:
; @end ; @end
#endif

View File

@@ -1,5 +1,5 @@
; *************************************************************************** ; ***************************************************************************
; copyright : (C) 2025 by Martin Preuss ; copyright : (C) 2026 by Martin Preuss
; email : martin@libchipcard.de ; email : martin@libchipcard.de
; ;
; *************************************************************************** ; ***************************************************************************
@@ -7,6 +7,9 @@
; * Please see toplevel file COPYING of that project for license details. * ; * Please see toplevel file COPYING of that project for license details. *
; *************************************************************************** ; ***************************************************************************
#ifndef AQH_AVR_NETWORK_MSG_VALUE_W_ASM
#define AQH_AVR_NETWORK_MSG_VALUE_W_ASM
; *************************************************************************** ; ***************************************************************************
; code ; code
@@ -125,3 +128,5 @@ netMsgValueWrite:
; @end ; @end
#endif