Adding an argument to PAL event callbacks Topic is solved

Use this forum for requesting small changes in ChibiOS. Large changes should be discussed in the development forum. This forum is NOT for support.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Adding an argument to PAL event callbacks

Post by Giovanni »

It makes sense, I will add switches to disable single ISRs without impacting others.

Giovanni
User avatar
FXCoder
Posts: 403
Joined: Sun Jun 12, 2016 4:10 am
Has thanked: 188 times
Been thanked: 134 times

Re: Adding an argument to PAL event callbacks

Post by FXCoder »

Thanks Giovanni.
I see you were busy on the weekend and the defines are there.

I added definitions in mcuconf.h for PAL vector override.
For consistency can I suggest adopting the same structure as used for other settings so that the setting can be explicitly shown (TRUE/FALSE)?
More work I know...

In mcuconf.h

Code: Select all

/*
 * PAL driver system settings.
 */
#define STM32_DISABLE_EXTI1_HANDLER         TRUE

etc...

Then in stm32_isr.c

Code: Select all

#if !STM32_DISABLE_EXTI1_HANDLER
/**
 * @brief   EXTI[1] interrupt handler.
 *
 * @isr
 */

etc...

And in stm32_isr.h

Code: Select all

/**
 * @name    Configuration options
 * @{
 */
/**
 * @brief   EXTI0 interrupt override setting.
 */
#if !defined(STM32_DISABLE_EXTI0_HANDLER) || defined(__DOXYGEN__)
#define STM32_DISABLE_EXTI0_HANDLER         FALSE
#endif

etc...
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Adding an argument to PAL event callbacks

Post by Giovanni »

Hi,

I prefer to not bring so many arcane switches in mcuconf.h, it is already quite complex as is. I think simple definitions are fine for this use case and need no checks.

Giovanni
User avatar
FXCoder
Posts: 403
Joined: Sun Jun 12, 2016 4:10 am
Has thanked: 188 times
Been thanked: 134 times

Re: Adding an argument to PAL event callbacks

Post by FXCoder »

OK.
So the preferred location is still mcuconf.h but just as plain #defines.
Correct?
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Adding an argument to PAL event callbacks

Post by Giovanni »

Correct, in alternative twitches could be placed in makefiles -D...

Giovanni
Post Reply