Prusa-Firmware-MMU/tests/unit
Yuri D'Elia 888cdf7cd5 Introduce compile-time axis unit type checks and conversions
Introduces:

- config::Unit: base class for physical quantities
- motion::AxisUnit: type-checked steps type

"config/unit.h" defines basic physical quantities, which are not
normally used elsewhere besides config.h.

"modules/axisunit.h" extends the modules::motion namespace with
Axis-aware units, with one type per axis per unit.

P_pos_t defines step positions for the pulley, I_pos_t for the idler,
etc. These are defined through the literar operators which are
similarly named and automatically convert a physical quantity to an
AxisUnit at compile time:

P_pos_t pulley_pos = 10.0_P_mm;

Besides type-checking, AxisUnit are otherwise identical to raw step
counts and are intended to be used along with the updated Motion API.

PlanMove/PlanMoveTo has been extended to support moves using these units
or physical quantities. Again, conversion is performed at compile time.
2021-07-25 16:39:54 +02:00
..
hal Disable preprocessor code indentation 2021-07-07 16:33:03 +02:00
logic Rename Motion::CurrentPos to Position() 2021-07-13 01:03:03 +02:00
modules Introduce compile-time axis unit type checks and conversions 2021-07-25 16:39:54 +02:00
CMakeLists.txt Do not use hard-to-read relative paths in CMake 2021-07-12 09:09:21 +02:00
system_test.cpp Remove invalid/useless test sizeof(ptr) == 4 2021-06-29 08:59:36 +02:00
test_main.cpp Add first unit test 2021-05-13 17:35:08 +02:00