InfiniTimeOrg / InfiniSim

Simulator for InfiniTime user interface without needing a PineTime
GNU General Public License v3.0
167 stars 67 forks source link

Implement new hardware abstraction from InfiniTime using C++20 concepts. #73

Open JF002 opened 2 years ago

JF002 commented 2 years ago

This PR implements the new hardware abstraction from https://github.com/InfiniTimeOrg/InfiniTime/pull/1387.

Notice that the C++ standard was upgraded from 17 to 20.

InfiniTime now defines an "interface" for the drivers (only Spi, SpiMaster and SpiNorFlash are modified right now). The application (InfiniTime / InfiniSim) must inject an actual implementation for the driver. This allows InfiniSim to inject its own implementation into the interface, instead of having to provide an alternative version of the same class (same name, same namespace, same constructor). This will probably allow to remove a lot of redefinitions and copy/paste InfiniSim had to make to implement the current drivers.