Skip to content

Commit

Permalink
Add check for series definition in ChibiOS targetPAL (#600)
Browse files Browse the repository at this point in the history
  • Loading branch information
josesimoes authored Feb 9, 2018
1 parent 2f33492 commit 22671a5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
10 changes: 7 additions & 3 deletions targets/CMSIS-OS/ChibiOS/Include/targetPAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <hal.h>


#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_
4 changes: 4 additions & 0 deletions targets/CMSIS-OS/ChibiOS/nanoCLR/targetPAL.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

#include <hal.h>

#if defined(STM32F0XX) || defined(STM32F4XX) || defined(STM32F7XX) || defined(STM32H7XX)

stm32_gpio_t* gpioPort[] = { GPIOA, GPIOB
#if STM32_HAS_GPIOC
, GPIOC
Expand Down Expand Up @@ -34,3 +36,5 @@ stm32_gpio_t* gpioPort[] = { GPIOA, GPIOB
, GPIOK
#endif
};

#endif // defined(STM32F0xx) || defined(STM32F4xx) || defined(STM32F7xx) || defined(STM32H7xx)
6 changes: 3 additions & 3 deletions targets/FreeRTOS/ESP32_DevKitC/Include/targetPAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_

0 comments on commit 22671a5

Please sign in to comment.