Extra compilation guards.

This commit is contained in:
Tracy Wadleigh 2020-05-26 08:06:03 -07:00
parent 47b1725a7d
commit e8cc54e995
2 changed files with 12 additions and 7 deletions

View File

@ -52,7 +52,7 @@
#if (PAL_USE_WAIT == TRUE) || (PAL_USE_CALLBACKS == TRUE)
palevent_t _pal_events[TOTAL_PORTS * PADS_PER_PORT];
#endif
#endif /* (PAL_USE_WAIT == TRUE) || (PAL_USE_CALLBACKS == TRUE) */
/*===========================================================================*/
/* Driver local functions. */
@ -79,6 +79,7 @@ static inline PORT_TypeDef* _pal_lld_ext_port(ioportid_t port) {
/* Driver interrupt handlers. */
/*===========================================================================*/
#if (PAL_USE_WAIT == TRUE) || (PAL_USE_CALLBACKS == TRUE)
/*
* Generic interrupt handler.
*/
@ -196,6 +197,8 @@ OSAL_IRQ_HANDLER(KINETIS_PORTE_IRQ_VECTOR) {
#endif /* !KINETIS_EXT_HAS_COMMON_CD_IRQ */
#endif /* (PAL_USE_WAIT == TRUE) || (PAL_USE_CALLBACKS == TRUE) */
/*===========================================================================*/
/* Driver exported functions. */
/*===========================================================================*/
@ -418,15 +421,15 @@ palevent_t* _pal_lld_get_pad_event(ioportid_t port,
iopadid_t pad) {
switch ((uint32_t)port) {
case GPIOA_BASE:
return &_pal_events[pad];
return _pal_events + pad;
case GPIOB_BASE:
return &_pal_events[PADS_PER_PORT + pad];
return _pal_events + PADS_PER_PORT + pad;
case GPIOC_BASE:
return &_pal_events[PADS_PER_PORT * 2 + pad];
return _pal_events + PADS_PER_PORT * 2 + pad;
case GPIOD_BASE:
return &_pal_events[PADS_PER_PORT * 3 + pad];
return _pal_events + PADS_PER_PORT * 3 + pad;
case GPIOE_BASE:
return &_pal_events[PADS_PER_PORT * 4 + pad];
return _pal_events + PADS_PER_PORT * 4 + pad;
default:
return NULL;
}

View File

@ -502,7 +502,7 @@ typedef struct {
extern const PALConfig pal_default_config;
#if (PAL_USE_WAIT == TRUE) || (PAL_USE_CALLBACKS == TRUE)
extern palevent_t _pal_events[TOTAL_PORTS * PADS_PER_PORT];
#endif
#endif /* (PAL_USE_WAIT == TRUE) || (PAL_USE_CALLBACKS == TRUE) */
#endif
#ifdef __cplusplus
@ -520,6 +520,7 @@ extern "C" {
void _pal_lld_writepad(ioportid_t port,
uint8_t pad,
uint8_t bit);
#if (PAL_USE_WAIT == TRUE) || (PAL_USE_CALLBACKS == TRUE)
palevent_t* _pal_lld_get_pad_event(ioportid_t port,
iopadid_t pad);
void _pal_lld_enablepadevent(ioportid_t port,
@ -529,6 +530,7 @@ extern "C" {
iopadid_t pad);
bool _pal_lld_ispadeventenabled(ioportid_t port,
iopadid_t pad);
#endif /* (PAL_USE_WAIT == TRUE) || (PAL_USE_CALLBACKS == TRUE) */
#ifdef __cplusplus
}
#endif