Untangle config dependencies, misc prefactors#2180
Untangle config dependencies, misc prefactors#2180aubsw wants to merge 6 commits intocommaai:masterfrom
Conversation
edb0879 to
f2508ad
Compare
f2508ad to
596e505
Compare
|
why is this needed exactly? this just seems to increase complexity to me without any real benefits can we keep #2175 to a minimal diff to just get everything building / working without shuffling too much code around. it's already a big enough change as it is |
| return (GPIO->IDR & (1UL << pin)) == (1UL << pin); | ||
| } | ||
|
|
||
| // cppcheck-suppress[misra-c2012-9.3,misra-c2012-8.7] |
There was a problem hiding this comment.
try not to suppress any misra errors like these, let's fix them instead
I did it this way because when I first started working this, it was the only way to unambiguously break the circular dependency chain–otherwise it was difficult to comprehend why compilation was busted. I disgree with you that this is adding complexity–I think that this is a strict reduction in complexity overall because it flattens the dependency heirarchy. You also need to keep track of less state when reading the code this way.
Definitely a fair consideration. At the very least we need to keep a dedicated header whose purpose is to plex on I think this is hopefully a fair compromise. Working on proving that this works seperately. |
|
Closing in favor of #2185 |
A pre-factor for #2171 in the interest of reducing diff size.
Config files refactor
We split the
board/config.hinto the following headers:include/board/stm_config.h: declarations + headers that depend on which STM microcontroller we're targetting.include/board/platform_definitions.h: declarations ONLY. To be included in source files that need to know about STM-dependent definitions, but don't need to know about all existing headers (IWYU).include/board/board_config.h: global value declarationsThere will be additional de-spaghetti-ification in subsequent PRs.
Misc refactors