From 15199a17a5804f889ae4858261bea31d4fda7c69 Mon Sep 17 00:00:00 2001 From: Martin Preuss Date: Mon, 21 Apr 2025 00:46:46 +0200 Subject: [PATCH] added ifdefs guards for includes. --- avr/common/crc8.asm | 7 +++++++ avr/common/m_fixedbuffers.asm | 5 ++++- avr/common/m_ringbuffer.asm | 5 +++++ avr/common/m_ringbuffer_y.asm | 5 ++++- avr/common/ringbuffer.asm | 5 +++++ avr/common/ringbuffer_y.asm | 8 ++++++++ avr/common/utils.asm | 6 ++++++ avr/common/utils_copy_from_flash.asm | 5 +++++ avr/common/utils_copy_sdram.asm | 6 ++++++ avr/common/utils_wait.asm | 5 +++++ avr/common/utils_wait_fixed.asm | 8 ++++++++ avr/common/utils_wait_pin.asm | 6 ++++++ avr/common/watchdog.asm | 5 +++++ avr/modules/basetimer/main.asm | 5 +++++ 14 files changed, 79 insertions(+), 2 deletions(-) diff --git a/avr/common/crc8.asm b/avr/common/crc8.asm index 76b0d2a..56e0794 100644 --- a/avr/common/crc8.asm +++ b/avr/common/crc8.asm @@ -7,6 +7,9 @@ ; * Please see toplevel file COPYING of that project for license details. * ; *************************************************************************** +#ifndef COMMON_CRC8_H +#define COMMON_CRC8_H + .cseg @@ -44,3 +47,7 @@ crc8Calc_withoutPoly: ret ; @end + + +#endif ; COMMON_CRC8_H + diff --git a/avr/common/m_fixedbuffers.asm b/avr/common/m_fixedbuffers.asm index b2831e1..364aa29 100644 --- a/avr/common/m_fixedbuffers.asm +++ b/avr/common/m_fixedbuffers.asm @@ -7,6 +7,9 @@ ; * Please see toplevel file COPYING of that project for license details. * ; *************************************************************************** +#ifndef COMMON_M_FIXEDBUFFERS_H +#define COMMON_M_FIXEDBUFFERS_H + ; --------------------------------------------------------------------------- ; @macro m_fixedbuf_init @@ -135,5 +138,5 @@ l_end: - +#endif ; COMMON_M_FIXEDBUFFERS_H diff --git a/avr/common/m_ringbuffer.asm b/avr/common/m_ringbuffer.asm index 343925a..e19680a 100644 --- a/avr/common/m_ringbuffer.asm +++ b/avr/common/m_ringbuffer.asm @@ -7,6 +7,9 @@ ; * Please see toplevel file COPYING of that project for license details. * ; *************************************************************************** +#ifndef COMMON_M_RINGBUFFER_H +#define COMMON_M_RINGBUFFER_H + ; --------------------------------------------------------------------------- @@ -107,3 +110,5 @@ l_end: +#endif ; COMMON_M_RINGBUFFER_H + diff --git a/avr/common/m_ringbuffer_y.asm b/avr/common/m_ringbuffer_y.asm index 8c32e50..26095c4 100644 --- a/avr/common/m_ringbuffer_y.asm +++ b/avr/common/m_ringbuffer_y.asm @@ -7,6 +7,9 @@ ; * Please see toplevel file COPYING of that project for license details. * ; *************************************************************************** +#ifndef COMMON_M_RINGBUFFER_Y_H +#define COMMON_M_RINGBUFFER_Y_H + ; --------------------------------------------------------------------------- @@ -149,4 +152,4 @@ l_end: - +#endif ; COMMON_M_RINGBUFFER_Y_H diff --git a/avr/common/ringbuffer.asm b/avr/common/ringbuffer.asm index 2695309..c3f9ba4 100644 --- a/avr/common/ringbuffer.asm +++ b/avr/common/ringbuffer.asm @@ -7,6 +7,8 @@ ; * Please see toplevel file COPYING of that project for license details. * ; *************************************************************************** +#ifndef COMMON_RINGBUFFER_H +#define COMMON_RINGBUFFER_H @@ -253,3 +255,6 @@ RINGBUFFER_END: .equ MODULE_SIZE_RINGBUFFER = RINGBUFFER_END-RINGBUFFER_BEGIN + +#endif ; COMMON_RINGBUFFER_H + diff --git a/avr/common/ringbuffer_y.asm b/avr/common/ringbuffer_y.asm index 7eba828..7652456 100644 --- a/avr/common/ringbuffer_y.asm +++ b/avr/common/ringbuffer_y.asm @@ -7,6 +7,12 @@ ; * Please see toplevel file COPYING of that project for license details. * ; *************************************************************************** +#ifndef COMMON_RINGBUFFER_Y_H +#define COMMON_RINGBUFFER_Y_H + +.include "common/m_ringbuffer_y.asm" + + .equ RINGBUFFERY_OFFS_MAXSIZE = 0 .equ RINGBUFFERY_OFFS_USED = 1 @@ -196,3 +202,5 @@ RingBufferY_WriteByteGuarded_error: +#endif ; COMMON_RINGBUFFER_Y_H + diff --git a/avr/common/utils.asm b/avr/common/utils.asm index 81ef3ea..ad9f87d 100644 --- a/avr/common/utils.asm +++ b/avr/common/utils.asm @@ -7,6 +7,9 @@ ; * Please see toplevel file COPYING of that project for license details. * ; *************************************************************************** +#ifndef COMMON_UTILS_H +#define COMMON_UTILS_H + @@ -554,3 +557,6 @@ Utils_TranslateByTable_found: UTILS_END: .equ MODULE_SIZE_UTILS = UTILS_END-UTILS_BEGIN + +#endif ; COMMON_UTILS_H + diff --git a/avr/common/utils_copy_from_flash.asm b/avr/common/utils_copy_from_flash.asm index 67b7b47..6ce2dff 100644 --- a/avr/common/utils_copy_from_flash.asm +++ b/avr/common/utils_copy_from_flash.asm @@ -7,6 +7,9 @@ ; * Please see toplevel file COPYING of that project for license details. * ; *************************************************************************** +#ifndef COMMON_UTILS_COPYFROMFLASH_H +#define COMMON_UTILS_COPYFROMFLASH_H + ; *************************************************************************** ; code @@ -33,3 +36,5 @@ Utils_CopyFromFlash: ret + +#endif ; COMMON_UTILS_COPYFROMFLASH_H diff --git a/avr/common/utils_copy_sdram.asm b/avr/common/utils_copy_sdram.asm index 5a35681..7ab2eeb 100644 --- a/avr/common/utils_copy_sdram.asm +++ b/avr/common/utils_copy_sdram.asm @@ -7,6 +7,9 @@ ; * Please see toplevel file COPYING of that project for license details. * ; *************************************************************************** +#ifndef COMMON_UTILS_COPYSDRAM_H +#define COMMON_UTILS_COPYSDRAM_H + ; *************************************************************************** ; code @@ -32,3 +35,6 @@ Utils_Copy_SDRAM: ret + +#endif ; COMMON_UTILS_COPYSDRAM_H + diff --git a/avr/common/utils_wait.asm b/avr/common/utils_wait.asm index 095d143..f9c5f76 100644 --- a/avr/common/utils_wait.asm +++ b/avr/common/utils_wait.asm @@ -7,6 +7,9 @@ ; * Please see toplevel file COPYING of that project for license details. * ; *************************************************************************** +#ifndef COMMON_UTILS_WAIT_H +#define COMMON_UTILS_WAIT_H + @@ -59,3 +62,5 @@ +#endif ; COMMON_UTILS_WAIT_H + diff --git a/avr/common/utils_wait_fixed.asm b/avr/common/utils_wait_fixed.asm index 9be3aba..82be877 100644 --- a/avr/common/utils_wait_fixed.asm +++ b/avr/common/utils_wait_fixed.asm @@ -7,6 +7,12 @@ ; * Please see toplevel file COPYING of that project for license details. * ; *************************************************************************** +#ifndef COMMON_UTILS_WAIT_FIXED_H +#define COMMON_UTILS_WAIT_FIXED_H + + +.include "common/utils_wait.asm" + @@ -54,3 +60,5 @@ Utils_WaitFor100MicroSecs: +#endif ; COMMON_UTILS_WAIT_FIXED_H + diff --git a/avr/common/utils_wait_pin.asm b/avr/common/utils_wait_pin.asm index e79741c..d0d415a 100644 --- a/avr/common/utils_wait_pin.asm +++ b/avr/common/utils_wait_pin.asm @@ -7,6 +7,10 @@ ; * Please see toplevel file COPYING of that project for license details. * ; *************************************************************************** +#ifndef COMMON_UTILS_WAIT_PIN_H +#define COMMON_UTILS_WAIT_PIN_H + + ; *************************************************************************** ; code @@ -52,3 +56,5 @@ com2WaitForDataState1ms_ret: +#endif ; COMMON_UTILS_WAIT_PIN_H + diff --git a/avr/common/watchdog.asm b/avr/common/watchdog.asm index 26616c6..5bde7e1 100644 --- a/avr/common/watchdog.asm +++ b/avr/common/watchdog.asm @@ -7,6 +7,9 @@ ; * Please see toplevel file COPYING of that project for license details. * ; *************************************************************************** +#ifndef COMMON_WATCHDOG_H +#define COMMON_WATCHDOG_H + ; *************************************************************************** @@ -46,3 +49,5 @@ watchdogOff: +#endif ; COMMON_WATCHDOG_H + diff --git a/avr/modules/basetimer/main.asm b/avr/modules/basetimer/main.asm index 7b83e17..d4c3ef8 100644 --- a/avr/modules/basetimer/main.asm +++ b/avr/modules/basetimer/main.asm @@ -7,6 +7,9 @@ ; * Please see toplevel file COPYING of that project for license details. * ; *************************************************************************** +#ifndef BASETIMER_MAIN_H +#define BASETIMER_MAIN_H + ; ; The base timer makes sure that "onSystemTimerTick" is called about every ; 100ms. @@ -198,3 +201,5 @@ BASETIMER_END: + +#endif ; BASETIMER_MAIN_H