Check for NULL ptr in HAL_PAL
Check for NULL ptr in HAL_PAL
The PAL driver dereferences a pointer to a peripheral address (i.e. GPIOA->ODR). The 'port' pointer should be checked for a NULL pointer using chDbgCheck() (so that it can be disabled for release builds).
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: Check for NULL ptr in HAL_PAL
The dereferencing is done mainly in the hal_pal_lld.h macro. I'm thinking we could do a null ptr check at the hal_pal layer before calling the LLD driver routines/macros.
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: Check for NULL ptr in HAL_PAL
bump
A point, the "port" parameter is not necessarily a pointer, it is dependent on architecture, this should be performed in the various LLDs.
Giovanni
A point, the "port" parameter is not necessarily a pointer, it is dependent on architecture, this should be performed in the various LLDs.
Giovanni