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: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: Adding an argument to PAL event callbacks

Postby Giovanni » Sat Sep 02, 2017 9:30 am

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

Giovanni

User avatar
FXCoder
Posts: 384
Joined: Sun Jun 12, 2016 4:10 am
Location: Sydney, Australia
Has thanked: 180 times
Been thanked: 130 times

Re: Adding an argument to PAL event callbacks

Postby FXCoder » Mon Sep 04, 2017 12:01 am

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: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: Adding an argument to PAL event callbacks

Postby Giovanni » Mon Sep 04, 2017 8:12 am

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: 384
Joined: Sun Jun 12, 2016 4:10 am
Location: Sydney, Australia
Has thanked: 180 times
Been thanked: 130 times

Re: Adding an argument to PAL event callbacks

Postby FXCoder » Mon Sep 04, 2017 8:24 am

OK.
So the preferred location is still mcuconf.h but just as plain #defines.
Correct?

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: Adding an argument to PAL event callbacks

Postby Giovanni » Mon Sep 04, 2017 8:51 am

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

Giovanni


Return to “Small Change Requests”

Who is online

Users browsing this forum: No registered users and 9 guests