Skip to content

feat: provide default functions only if requested - #71

Merged
fpistm merged 1 commit into
stm32duino:mainfrom
fpistm:noBlink
Jul 25, 2024
Merged

fpistm merged 1 commit into
stm32duino:mainfrom
fpistm:noBlink

Conversation

@fpistm

@fpistm fpistm commented Jul 25, 2024

Copy link
Copy Markdown
Member

configUSE_MALLOC_FAILED_HOOK and configCHECK_FOR_STACK_OVERFLOW allow to define specific function to call when a malloc failed or a stack overflow occured.
Respectively, vApplicationIdleHook and vApplicationStackOverflowHook.

Previous implementation provide them unconditionally preventing users to define their own implementation. Now extra config is required to have the default implementation:

/* Set to 1 to use default blink hook if configUSE_MALLOC_FAILED_HOOK is 1 */ #ifndef configUSE_MALLOC_FAILED_HOOK_BLINK
  #define configUSE_MALLOC_FAILED_HOOK_BLINK  0
#endif
/* Set to 1 to used default blink if configCHECK_FOR_STACK_OVERFLOW is 1 or 2 */ #ifndef configCHECK_FOR_STACK_OVERFLOW_BLINK
  #define configCHECK_FOR_STACK_OVERFLOW_BLINK 0
#endif

Fixes #69.

configUSE_MALLOC_FAILED_HOOK and configCHECK_FOR_STACK_OVERFLOW
allow to define specific function to call when a malloc failed
or a stack overflow occured.
Respectively, vApplicationIdleHook and vApplicationStackOverflowHook.

Previous implementation provide them unconditionally preventing users
to define their own implementation. Now extra config is required to
have the default implementation:

/* Set to 1 to use default blink hook if configUSE_MALLOC_FAILED_HOOK is 1 */
#ifndef configUSE_MALLOC_FAILED_HOOK_BLINK
  #define configUSE_MALLOC_FAILED_HOOK_BLINK  0
#endif
/* Set to 1 to used default blink if configCHECK_FOR_STACK_OVERFLOW is 1 or 2 */
#ifndef configCHECK_FOR_STACK_OVERFLOW_BLINK
  #define configCHECK_FOR_STACK_OVERFLOW_BLINK 0
#endif


Fixes stm32duino#69.

Signed-off-by: Frederic Pillon <[email protected]>
@fpistm fpistm added the enhancement New feature or request label Jul 25, 2024
@fpistm fpistm added this to the 10.3.3 milestone Jul 25, 2024
@fpistm
fpistm merged commit d05df76 into stm32duino:main Jul 25, 2024
@fpistm
fpistm deleted the noBlink branch July 25, 2024 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Development

Successfully merging this pull request may close these issues.

Documentation suggestion for configCHECK_FOR_STACK_OVERFLOW and for LED_BUILTIN

1 participant