Cleanup in PAL driver.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12559 110e8d01-0319-4d1e-a829-52ad28d1bb01
This commit is contained in:
Giovanni Di Sirio 2019-01-19 16:24:52 +00:00
parent 675ee683d0
commit c16c4e516e
9 changed files with 23 additions and 11 deletions

View File

@ -147,6 +147,7 @@
*/ */
typedef void (*palcallback_t)(void *arg); typedef void (*palcallback_t)(void *arg);
#if (PAL_USE_WAIT == TRUE) || (PAL_USE_CALLBACKS == TRUE) || defined(__DOXYGEN__)
/** /**
* @brief Type of a PAL event record. * @brief Type of a PAL event record.
*/ */
@ -168,6 +169,7 @@ typedef struct {
void *arg; void *arg;
#endif #endif
} palevent_t; } palevent_t;
#endif
#include "hal_pal_lld.h" #include "hal_pal_lld.h"

View File

@ -49,10 +49,12 @@
/* Driver exported variables. */ /* Driver exported variables. */
/*===========================================================================*/ /*===========================================================================*/
#if (PAL_USE_WAIT == TRUE) || (PAL_USE_CALLBACKS == TRUE) || defined(__DOXYGEN__)
/** /**
* @brief Event records for the 16 GPIO EXTI channels. * @brief Event records for the 16 GPIO EXTI channels.
*/ */
palevent_t _pal_events[16]; palevent_t _pal_events[16];
#endif
/*===========================================================================*/ /*===========================================================================*/
/* Driver local variables and types. */ /* Driver local variables and types. */

View File

@ -430,8 +430,10 @@ typedef uint32_t iopadid_t;
#if !defined(__DOXYGEN__) #if !defined(__DOXYGEN__)
extern const PALConfig pal_default_config; extern const PALConfig pal_default_config;
#if (PAL_USE_WAIT == TRUE) || (PAL_USE_CALLBACKS == TRUE)
extern palevent_t _pal_events[16]; extern palevent_t _pal_events[16];
#endif #endif
#endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {

View File

@ -34,10 +34,12 @@
/* Driver exported variables. */ /* Driver exported variables. */
/*===========================================================================*/ /*===========================================================================*/
#if (PAL_USE_WAIT == TRUE) || (PAL_USE_CALLBACKS == TRUE) || defined(__DOXYGEN__)
/** /**
* @brief Event records for the 16 GPIO EXTI channels. * @brief Event records for the 16 GPIO EXTI channels.
*/ */
palevent_t _pal_events[16]; palevent_t _pal_events[16];
#endif
/*===========================================================================*/ /*===========================================================================*/
/* Driver local variables and types. */ /* Driver local variables and types. */

View File

@ -487,8 +487,10 @@ typedef uint32_t iopadid_t;
(bool)((EXTI->IMR & (1U << (uint32_t)pad)) != 0U) (bool)((EXTI->IMR & (1U << (uint32_t)pad)) != 0U)
#if !defined(__DOXYGEN__) #if !defined(__DOXYGEN__)
#if (PAL_USE_WAIT == TRUE) || (PAL_USE_CALLBACKS == TRUE)
extern palevent_t _pal_events[16]; extern palevent_t _pal_events[16];
#endif #endif
#endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {

View File

@ -43,10 +43,12 @@
/* Driver exported variables. */ /* Driver exported variables. */
/*===========================================================================*/ /*===========================================================================*/
#if (PAL_USE_WAIT == TRUE) || (PAL_USE_CALLBACKS == TRUE) || defined(__DOXYGEN__)
/** /**
* @brief Event records for the 16 GPIO EXTI channels. * @brief Event records for the 16 GPIO EXTI channels.
*/ */
palevent_t _pal_events[16]; palevent_t _pal_events[16];
#endif
/*===========================================================================*/ /*===========================================================================*/
/* Driver local variables and types. */ /* Driver local variables and types. */

View File

@ -527,8 +527,10 @@ typedef uint32_t iopadid_t;
(bool)((EXTI->IMR & (1U << (uint32_t)pad)) != 0U) (bool)((EXTI->IMR & (1U << (uint32_t)pad)) != 0U)
#if !defined(__DOXYGEN__) #if !defined(__DOXYGEN__)
#if (PAL_USE_WAIT == TRUE) || (PAL_USE_CALLBACKS == TRUE)
extern palevent_t _pal_events[16]; extern palevent_t _pal_events[16];
#endif #endif
#endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {

View File

@ -52,15 +52,10 @@
/** /**
* @brief STM32 I/O ports configuration. * @brief STM32 I/O ports configuration.
* @details Ports A-D(E, F, G, H) clocks enabled.
*
* @param[in] config the STM32 ports configuration
* *
* @notapi * @notapi
*/ */
void _pal_lld_init(const PALConfig *config) { void _pal_lld_init(void) {
(void)config;
} }

View File

@ -31,6 +31,10 @@
/* Unsupported modes and specific modes */ /* Unsupported modes and specific modes */
/*===========================================================================*/ /*===========================================================================*/
/* Specifies palInit() without parameter, required until all platforms will
be updated to the new style.*/
#define PAL_NEW_INIT
/*===========================================================================*/ /*===========================================================================*/
/* I/O Ports Types and constants. */ /* I/O Ports Types and constants. */
/*===========================================================================*/ /*===========================================================================*/
@ -141,11 +145,9 @@ typedef uint32_t iopadid_t;
/** /**
* @brief Low level PAL subsystem initialization. * @brief Low level PAL subsystem initialization.
* *
* @param[in] config architecture-dependent ports configuration
*
* @notapi * @notapi
*/ */
#define pal_lld_init(config) _pal_lld_init(config) #define pal_lld_init() _pal_lld_init()
/** /**
* @brief Reads the physical I/O port states. * @brief Reads the physical I/O port states.
@ -426,14 +428,15 @@ typedef uint32_t iopadid_t;
&_pal_events[0]; (void)line &_pal_events[0]; (void)line
#if !defined(__DOXYGEN__) #if !defined(__DOXYGEN__)
extern const PALConfig pal_default_config; #if (PAL_USE_WAIT == TRUE) || (PAL_USE_CALLBACKS == TRUE)
extern palevent_t _pal_events[1]; extern palevent_t _pal_events[1];
#endif #endif
#endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
void _pal_lld_init(const PALConfig *config); void _pal_lld_init(void);
void _pal_lld_setgroupmode(ioportid_t port, void _pal_lld_setgroupmode(ioportid_t port,
ioportmask_t mask, ioportmask_t mask,
iomode_t mode); iomode_t mode);