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: 14444
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1074 times
- Been thanked: 921 times
- Contact:
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: 14444
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1074 times
- Been thanked: 921 times
- Contact:
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
Return to “Small Change Requests”
Who is online
Users browsing this forum: No registered users and 1 guest