On 2/6/2021 9:12 AM, Grr wrote:
It is very non-modular if it exposes internal data.  Tha must be
strictly avoided and prohibited in all cases.

So you mean exposing STM32_BOARD_XTAL and STM32_SYSCLK_FREQUENCY is OK but
exposing board IO port address violates modularity

That logic escapes me

That is okay because it not part of a modular interfaces.  It would be better if that data were obfuscated behind an interface, but that would not be work the effort.  Data definitions are freely shared between logic under boards/ and arch/.  They are really one thing that is segregated to support multiple architectures and boards.  Those interfaces are not modular.

board.h is certainly overloaded in its customers.  There are other header files that provide information, but do not define formal interfaces either.  The same applies there.

But for modular interface... i.e., formal interfaces that are exported between other components ... they must ALWAYS follow the standard, industry-wide modular architectural principles (for example https://www.cs.princeton.edu/courses/archive/spring17/cos217/lectures/10_ModularityHeuristics.pdf) without exception and must NEVER be permitted to expose internal implementation details ... EVER.


Reply via email to