In testhal, the various HAL peripheral configuration structures are continuously redefined in the portab.c/h files. The configuration structures should be defined in the actual application code (main.c in all the testhal applications I've seen ...), and the non-portable board specific parts of the struct should be defined as a macro in portab.h (as is the intended function of portab.c/.h). Thus, main.c would contain the platform agnostic portions of the configuration struct, and portab.h would contain non-portable parts.
This would demonstrate the true portable nature of the HAL, and show a clean separation between the upper layer and the lower layer.
From a maintainer's standpoint (that's you Giovanni ), it is less burden on ensuring all the peripheral configurations are the same between the various boards a particular multi testhal application supports.
See this post for an example:
viewtopic.php?f=24&t=5012&p=34929#p34929
testhal: Separate portable parts of HAL structs from non-portable
- 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: testhal: Separate portable parts of HAL structs from non-portable
That is a pretty good idea.
Giovanni
Giovanni
Return to “Small Change Requests”
Who is online
Users browsing this forum: No registered users and 28 guests