pez-globo / pufferfish-software

All software for the Pufferfish ventilator.
Apache License 2.0
0 stars 1 forks source link

Standardize namespaces, file paths, and their correspondences #148

Open ethanjli opened 4 years ago

ethanjli commented 4 years ago

Right now the namespace vs. file path relationships for drivers and HAL modules are not totally consistent/logical. We should move all driver modules into drivers, and we should establish a 1-to-1 correspondence between namespace paths and file paths everywhere. For example, the STM32 HAL modules are currently in files like Pufferfish/HAL/STM32/HALPWM.h and classes like Pufferfish::HAL::HALPWM; they should instead be in files like Pufferfish/HAL/STM32/PWM.h and classes like Pufferfish::HAL::STM32::PWM.

ethanjli commented 3 years ago

308 is a subset of this issue; for this issue we should also make sure that namespaces and file paths are logical for all drivers, not just for the HAL. @rohanpurohit this could also be a good one for Raavi to work on as a first task together with #308.

ethanjli commented 3 years ago

An exception to this is that it may be acceptable to define inner namespaces inside files to help organize variables, e.g. as in https://github.com/pez-globo/pufferfish-software/blob/27d44e4bc473fc011b55cfa1061bdc272f19139c/firmware/ventilator-controller-stm32/Core/Inc/Pufferfish/Driver/Serial/FDO2/Commands.h . However, if the file becomes too big, it may be better to convert it into a folder with files, each of which corresponds to one sub-namespace. (cc @rohanpurohit )