diff --git a/targets/CMSIS-OS/ChibiOS/Include/targetPAL.h b/targets/CMSIS-OS/ChibiOS/Include/targetPAL.h index 271ad5e63a..23917484ca 100644 --- a/targets/CMSIS-OS/ChibiOS/Include/targetPAL.h +++ b/targets/CMSIS-OS/ChibiOS/Include/targetPAL.h @@ -3,16 +3,20 @@ // See LICENSE file in the project root for full license information. // -#ifndef _GPIO_PORT -#define _GPIO_PORT +#ifndef _TARGETPAL_H_ +#define _TARGETPAL_H_ #include +#if defined(STM32F0XX) || defined(STM32F4XX) || defined(STM32F7XX) || defined(STM32H7XX) + // Contains available GPIO ports for the current board extern stm32_gpio_t* gpioPort[]; //Gets the GPIO according to a pin number #define GPIO_PORT(pin) (gpioPort[pin/16]) -#endif +#endif // defined(STM32F0xx) || defined(STM32F4xx) || defined(STM32F7xx) || defined(STM32H7xx) + +#endif // _TARGETPAL_H_ diff --git a/targets/CMSIS-OS/ChibiOS/nanoCLR/targetPAL.c b/targets/CMSIS-OS/ChibiOS/nanoCLR/targetPAL.c index 9cff098439..3f0c44df01 100644 --- a/targets/CMSIS-OS/ChibiOS/nanoCLR/targetPAL.c +++ b/targets/CMSIS-OS/ChibiOS/nanoCLR/targetPAL.c @@ -5,6 +5,8 @@ #include +#if defined(STM32F0XX) || defined(STM32F4XX) || defined(STM32F7XX) || defined(STM32H7XX) + stm32_gpio_t* gpioPort[] = { GPIOA, GPIOB #if STM32_HAS_GPIOC , GPIOC @@ -34,3 +36,5 @@ stm32_gpio_t* gpioPort[] = { GPIOA, GPIOB , GPIOK #endif }; + +#endif // defined(STM32F0xx) || defined(STM32F4xx) || defined(STM32F7xx) || defined(STM32H7xx) diff --git a/targets/FreeRTOS/ESP32_DevKitC/Include/targetPAL.h b/targets/FreeRTOS/ESP32_DevKitC/Include/targetPAL.h index c0ed853425..42d1f49456 100644 --- a/targets/FreeRTOS/ESP32_DevKitC/Include/targetPAL.h +++ b/targets/FreeRTOS/ESP32_DevKitC/Include/targetPAL.h @@ -3,9 +3,9 @@ // See LICENSE file in the project root for full license information. // -#ifndef _GPIO_PORT -#define _GPIO_PORT +#ifndef _TARGETPAL_H_ +#define _TARGETPAL_H_ -#endif +#endif // _TARGETPAL_H_