[PATCH] STM32H7 BSP: Commented out legacy define which causes nameclashes
Joel Sherrill
joel at rtems.org
Thu Jan 28 13:17:12 UTC 2021
I think this is ok. A BSP should not be defining standard named symbols.
Does any code internally use PAGESIZE? Just checking for side-effects.
It probably should be in an ifndef RTEMS block with a comment above to make
it easier to potentially update this file in the future.
--joel
On Thu, Jan 28, 2021, 6:25 AM Robin Mueller <robin.mueller.m at gmail.com>
wrote:
> ---
>
> I had a warning related to nameclash of defines for the arm/stm32h7 BSP.
> More specifically, the define PAGESIZE which is defined in
> stm32_hal_legacy.h
> as well as in limits.h (which is located in arm-rtems6/include)
>
> I solved the problem for now by commenting out the define in
> stm32_hal_legacy.h
>
> The BSP still built without issues. I searched the stm32h7 BSP folder in
> the sources
> to check whether the legacy define is actually used somewhere and it is
> not.
>
> bsps/arm/stm32h7/include/Legacy/stm32_hal_legacy.h | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/bsps/arm/stm32h7/include/Legacy/stm32_hal_legacy.h
> b/bsps/arm/stm32h7/include/Legacy/stm32_hal_legacy.h
> index c311c1618e..c4fa5d7151 100644
> --- a/bsps/arm/stm32h7/include/Legacy/stm32_hal_legacy.h
> +++ b/bsps/arm/stm32h7/include/Legacy/stm32_hal_legacy.h
> @@ -420,7 +420,9 @@
> #define TYPEPROGRAMDATA_FASTBYTE FLASH_TYPEPROGRAMDATA_FASTBYTE
> #define TYPEPROGRAMDATA_FASTHALFWORD FLASH_TYPEPROGRAMDATA_FASTHALFWORD
> #define TYPEPROGRAMDATA_FASTWORD FLASH_TYPEPROGRAMDATA_FASTWORD
> -#define PAGESIZE FLASH_PAGE_SIZE
> +/* Commented out for the RTEMS BSP because there can be nameclashes with
> another
> +similar defininition in limits.h */
> +//#define PAGESIZE FLASH_PAGE_SIZE
> #define TYPEPROGRAM_FASTBYTE FLASH_TYPEPROGRAM_BYTE
> #define TYPEPROGRAM_FASTHALFWORD FLASH_TYPEPROGRAM_HALFWORD
> #define TYPEPROGRAM_FASTWORD FLASH_TYPEPROGRAM_WORD
> --
> 2.29.2.windows.2
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20210128/8057eed9/attachment.html>
More information about the devel
mailing list