Commit Graph

289 Commits (87d85cf0bf2d134c1fff2c62e93a4e14e6ba9d8f)

Author SHA1 Message Date
Yuri D'Elia b7fcfa5cb5 Add tests for single and multi-axis AbortPlannedMoves()
This introduces a new #define UNITTEST_MOTION which is used to control
the testing scenario:

- Normal tests, we allow the stub to override the built-in definition.
- For motion tests, we stub the lower-level classes and test the
  effective implementation

We also repeat the prototype of the function, which IMHO is more
readable and more flexible: we need to use inline for the real
definition, which would require even more macros otherwise.
2021-09-07 15:09:49 +02:00
D.R.racer 37ff9b8a8f Fix unit tests for AbortPlannedMoves(axis) 2021-09-07 15:03:36 +02:00
D.R.racer 52a6d57704 Remove Motion::Home completely 2021-09-07 15:03:36 +02:00
D.R.racer 315530ec16 Rebase onto main, reflect FINDA change (ADC->digital pin) in unit tests 2021-09-02 12:15:55 +02:00
D.R.racer 5a53acd802 Force Tool Change to load the filament if same slot but not loaded
MMU-63
2021-09-02 12:15:55 +02:00
Yuri D'Elia e7cba346da Use relative paths for panic.h
Avoids adding the main directory as an include path
2021-09-02 12:00:59 +02:00
Yuri D'Elia ee8c80e5c4 Motion: Panic if queue is full
If the queue is full and a new move is queued, panic!

Introduce a new error code QUEUE_FULL to help diagnose situations where
the queue is handled improperly: likely one of the state machines not
waiting for the previous actions to finish.

PulseGen::PlanMove returns a boolean if the queue cannot be moved.
We could extend this to Motion::PlanMove, however all moves would then
have to check for this. Having a global check such as this ensures
we never ignore such situation.
2021-09-02 12:00:59 +02:00
D.R.racer b708e67a19 Verify repeated calls to Step do not change from ERRTMCFailed 2021-09-02 08:35:56 +02:00
D.R.racer 161e46b09a Add unit tests for failing TMC
more stuff will follow as these situations seem to cause various issues
2021-09-02 08:35:56 +02:00
D.R.racer 1d884d9099 Make motion::QueueEmpty inline for non-UNITTEST builds 2021-09-02 08:35:56 +02:00
D.R.racer ffe5bc2807 Make Idler and Selector only wait for their own axis
... and fix the unit tests for this
2021-09-02 08:35:56 +02:00
D.R.racer 74629f0103 Fix reporting progress of running commands
The problem was the error state while running a command - we never used the RUNNING error state.
2021-09-02 08:35:56 +02:00
3d-gussner 763e33f79a Fix unit test: unload_filament 2021-08-31 06:59:29 +02:00
3d-gussner d5e473f9c9 Fix unit test: tool_change 2021-08-31 06:59:29 +02:00
3d-gussner 12cf25511a Fix unit test: load_filament 2021-08-31 06:59:29 +02:00
3d-gussner 3d121c1ca9 Fix unit test: unload_to_finda 2021-08-31 06:59:29 +02:00
3d-gussner 382a2c8dc0 Fix unit test: feed_to_finda 2021-08-31 06:59:29 +02:00
3d-gussner a7a55b4039 Fix unit test: cut_fillament 2021-08-31 06:59:29 +02:00
D.R.racer 06c46b20a6 Turn off green LED after load/unload finished successfully
MMU-65
2021-08-30 17:34:46 +02:00
Yuri D'Elia 04631677cc Motion/PulseGen: implement move chaining and end-speed control
Allow to chain moves by adding one extra parameter to the PlanMove[to]
functions: ending speed.

A move will always be accelerated from the last speed towards end ending
speed. The following:

  PlanMove(100._mm, 50._mm_s, 50._mm_s);
  PlanMove(200._mm, 100._mm_s);

Will first move the axis 100mm, accelerating towards 50mm/s, then
accelerate again to 100mm/s. The move will for then decelerate towards a
full stop after reaching 300mm in total.

Acceleration can be changed for each segment, so that a custom
acceleration curve can be created:

  SetAcceleration(10._mm_s2);
  PlanMove(100._mm, 50._mm_s, 50._mm_s);
  SetAcceleration(100._mm_s2);
  PlanMove(100._mm, 50._mm_s, 50._mm_s);

The ending speed might not always be reached, depending on the current
acceleration settings. The new function "Rate()" will return the ending
feedrate of the last move, if necessary.

AbortPlannedMoves accepts a new "halt" parameter to control how moves
will be chanined when interrupting the current move. By default
(halt=true) the move is completely interrupted.

When halt=false is requested, a subsequent move will be chained starting
at the currently aborted velocity. This allows to chain moves in reponse
to events, for example to accelerate the pulley without stopping as soon
as the FINDA is triggered, it's sufficient to interrupt the current move
followed by a new one:

  PlanMove(maximum_loading_lenght, slow_feedrate);
  ... wait for PINDA trigger ...
  AbortPlannedMoves(true);
  PlanMove(bowden_lenght, fast_feedrate);

will seamlessy continue loading and transition to the fast feedrate.

Jerk control has been simplified. It now handles only the maximal
velocity change of the last segment, which doesn't require reverse
planning.
2021-08-30 12:49:34 +02:00
Yuri D'Elia d55e01bb58 Motion/PulseGen: allow to abort a move for chaining
Add a new parameter "halt" (default to true) to control the stopping
behavior:

- halt=true: no subsequent moves will be planned, motions stops abruptly
- half=false: a new move will be chained after the current one
2021-08-30 12:49:34 +02:00
Yuri D'Elia fe621eb280 test_motion_ramp: improve robustness when checking multiple axes
When checking multiple axes together, also reconstruct the step rate, so
that subsequent checks do not fail randomly.
2021-08-30 07:10:54 +02:00
Yuri D'Elia e4af0717f6 test_ramp_gen: cosmetic fixes 2021-08-30 07:10:54 +02:00
Yuri D'Elia bb9e2a075b temp_motion_ramp: test single and multiple axes moving
stepTimerQuantum introduces discretization error, which makes the
acceleration curves noisy.

In rampgen generate ramps for a single moving axis in addition
of two axes moving together.

Then, in test_ramp_gen, test a single axis moving accurately, while
allow for some discretization error when two (or more) axes are running.
2021-08-30 07:10:54 +02:00
Yuri D'Elia 734612238e test_motion_ramp: do not skip tests
Remove a debugging left-over causing just the first ramp to be checked
2021-08-30 07:10:54 +02:00
Yuri D'Elia 1b0a67826a Improve motion::unit tests to handle fractional scaling
Pulley doesn't result in an exact step count due to the fractional
count.result in an exact step count due to the fractional count.

Use Selector instead to test values exacly.

Still check Pulley and Idler, but allowing for a +/-1 step of rounding
error.
2021-08-25 09:16:56 +02:00
Yuri D'Elia 288e74283d Introduce config::MRes and fix (real) axis units
The parameter config::AxisConfig::uSteps was supposed to be
microstepping resolution, but it's instead being used as the driver's
MRES directly.

To avoid a runtime conversion, rename the field to mRes and define a new
enum listing all the possible (and valid) microstepping resolutions.

This simplifies the code and makes clear the stepsPerUnit scale.

Assign correct stepsPerUnit to all axes as a result, including working
limits.
2021-08-25 09:16:56 +02:00
Yuri D'Elia f7f0df4afa Move hal/avr/tmc2130 into hal/ directly
There are no dependencies on AVR in TMC2130, so move into the main tree
2021-08-25 07:57:19 +02:00
Yuri D'Elia 6a9f2a2df9 Motion: test the middle driver's Enabled status too 2021-08-25 07:57:19 +02:00
Yuri D'Elia 0548c17078 Motion: test low-level enable changes via GPIO stub
This fixes the driver's enable/disable incorrectly setting the direction
bit instead.
2021-08-25 07:57:19 +02:00
Yuri D'Elia 8e24d1e084 Motion: Use an SPI stub in order to test TMC2130 2021-08-25 07:57:19 +02:00
Yuri D'Elia 9a93ebecfc Motion: add tests for the axis autoenable
Add Motion::Enabled() to get the current axis enablement status.
2021-08-25 07:57:19 +02:00
Alex Voinea 36e63e678c Fix tests 2021-08-23 08:18:47 +02:00
Yuri D'Elia 0d1441b721 Skip motion::test_motion_ramp test if pandas is not installed 2021-08-12 17:50:07 +02:00
Yuri D'Elia d8454df5af Add rampgen as a dependency of tests 2021-08-12 17:50:07 +02:00
Yuri D'Elia 240f4c28ab Complete motion ramp checks
- Add additional information in the output generated by rampgen in order
  to allow recalculating the acceleration curves independently
- Implement motion ramp checks inside test_motion_ramp.py

test_motion_ramp reads the output of a merged stepping sequence and
splits the motion of each axis, checking the acceleration curves
independently.

This ensures both that the acceleration curves are correct (as generated
by the PulseGen class) and that the multiplexed moves are too.

The nominal rate is checked exactly, while the acceleration/deceleration
segment allow for some deviation from an ideal curve.

This is currently 5% for both expected speed and acceleration, with
an absolute limit of 20mm/s of maximum difference in each point.
2021-08-12 17:50:07 +02:00
Yuri D'Elia 89ab29dbde Move motion::dual_move_ramp into the separate motion::rampgen test
- Remove motion::dual_move_ramp from the Catch2 tests and reimplement
  it as a minimal c++ program for the ramp validation.
- Add a skeleton python validator to check the ramp output
- Use test "fixtures" to ensure the rampgen is run (both as a test,
  and to generate output) when the test_motion_ramp.py is requested.
2021-08-12 17:50:07 +02:00
Yuri D'Elia f37c9e363c Remove no-longer-needed operators import 2021-08-12 17:50:07 +02:00
D.R.racer 87d0f1c8f7 Add K1, 2, 3, 4 into unit tests 2021-08-12 10:55:27 +02:00
D.R.racer f0b8cc9895 Fix encoding of Query responses for high numbers of errors
+ improve unit tests directly for the enumerated errors in logic/error_codes.h
2021-08-12 10:55:27 +02:00
D.R.racer e0ea47595f Add unit tests for logic state machines reusal
as it will work in the real FW
2021-08-12 10:30:40 +02:00
D.R.racer 9ba116e06e Handle slot indices out of range correctly at top level
Besides Unload Filament, which only operates on active slot, all other
top level state machines check the validity of the command's parameter.
If the parameter is out of range for available slots, they return
ErrorCode::INVALID_TOOL now.
2021-08-12 10:30:40 +02:00
D.R.racer 2053729a75 Fix LED unit tests 2021-08-04 11:40:02 +02:00
D.R.racer 2f5dff6c5b Introduce short namespace aliases
especially for modules
2021-08-04 11:03:56 +02:00
D.R.racer 8694c53033 Fixes after rebase onto main 2021-08-02 10:52:18 +02:00
D.R.racer aa5995368d Update to latest main + fix unit tests
... in relation to the newly introduced stepping in physical units rather than in steps
2021-08-02 10:52:18 +02:00
D.R.racer 16dc129b49 Set real slot positions for the Idler and Selector
Extracted from the previous FW, may need some tuning based on units selected
for each of these axes (degrees, millimeters) - waiting for an update
of the motion implementation.

Updated starting conditions of the unit tests to reflect the global configuration.

MMU-58
2021-08-02 10:52:18 +02:00
D.R.racer ef96d998a3 Link top level error reporting to TMC2130 error flags 2021-08-02 07:45:45 +02:00
D.R.racer 751ee46450 Add bit masks for error codes for the TMC drivers
+ add common error handling for idler and selector
+ improve error handling in command_base
+ rename ERR1xxxx errors to ERRxxxx (remove the '1')
2021-08-02 07:45:45 +02:00
D.R.racer df2c1ba7fe Add prototype of unified handling of HW errors in the logic layer 2021-08-02 07:45:45 +02:00
D.R.racer f5df642eb5 Improve error codes
- Distinguish among FINDA on/off failuje
- The same applies to newly introduced Filament sensor errors
- Add TMC init error
- Add a communication error ID - to be used on the printer
2021-08-02 07:45:45 +02:00
D.R.racer a8147be803 Fix unit tests + rebase onto main + extract TMC parameters into config 2021-07-29 10:01:33 +02:00
D.R.racer 3d1880c006 Make tests compile
Introduces a nasty hack to forcefully write into the constexpr SPI descriptor's registers
(which is the correct way in ASM, but kind of cumbersome in C++ now)
2021-07-29 10:01:33 +02:00
DRracer dc36afb82c
Merge branch 'main' into motion_units 2021-07-26 09:35:13 +02:00
D.R.racer 6af65bc4c8 Rename ISR -> Isr to avoid clash with AVR libc ISR #define 2021-07-26 09:34:24 +02:00
Yuri D'Elia d955897829 Convert config::selectorSlotPositions to physical units 2021-07-25 23:13:28 +02:00
Yuri D'Elia 6daf7fd060 Convert config::idlerSlotPositions to physical units 2021-07-25 22:39:18 +02:00
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
Yuri D'Elia 5e04d4ccaf Add getters/setters for Jerk in Motion/PulseGen
This allows us to make tests that expect jerk to be the same across two
axes, even if they're statically configured differently.
2021-07-25 01:24:40 +02:00
D.R.racer f62cb99b13 Fix TMC2130 stub
so that motion unit tests build and run
2021-07-14 08:38:10 +02:00
Yuri D'Elia f28567a051 Motion tests: improve comments 2021-07-13 20:21:28 +02:00
Yuri D'Elia 324fb92fd5 Motion: implement timer multiplexing 2021-07-13 19:21:13 +02:00
Yuri D'Elia d0581bf494 Motion: Add more methods and tests
- Add SetPosition/CurPosition (not only) for testing
- Implement some real tests
2021-07-13 17:43:50 +02:00
Yuri D'Elia 4fd22f0656 Motion: add initial test infrastructure and stubs 2021-07-13 16:16:56 +02:00
Yuri D'Elia 18ced44341 Merge remote-tracking branch 'upstream/main' into motion_wip 2021-07-13 15:31:31 +02:00
Yuri D'Elia 98845008aa Rename Motion::CurrentPos to Position()
This matches PulseGen::Position() and avoids confusion around the term
"current": Position() returns the head position in the queue, not the
"live" axis position.

We have PulseGen::CurPosition() now for this purpose, although we don't
expose it to Motion yet.
2021-07-13 01:03:03 +02:00
Yuri D'Elia 16e7f62aee PulseGen: introduce CurPosition() for testing
CurPosition() returns the live axis position, which in this
implementation is inherently expensive to compute.

This shouldn't be required for the MMU, but it /will/ come in handy to
check for the axis position/s in Motion tests.
2021-07-13 00:48:44 +02:00
D.R.racer eed1c3f07a Fix buttons unit tests after ADC update 2021-07-12 18:01:57 +02:00
VintagePC 55637e6055 Fix pathing for gcovr 2021-07-12 12:50:06 +02:00
VintagePC b0c25e8bd4 Fix handling failed tests. 2021-07-12 12:50:06 +02:00
VintagePC dc161812f3 First take, WIP 2021-07-12 12:50:06 +02:00
Yuri D'Elia a5a91cbaa8 tests: remove relative cmake paths in pulse_gen/speed_table 2021-07-12 11:11:49 +02:00
Yuri D'Elia 787c73ecff Merge remote-tracking branch 'upstream/main' into motion_wip 2021-07-12 10:25:06 +02:00
Yuri D'Elia 9b0dd2d633 Motion: fix new Step() prototype 2021-07-12 09:58:53 +02:00
Alan Dragomirecký cf5b1c3955 Do not use hard-to-read relative paths in CMake 2021-07-12 09:09:21 +02:00
Alan Dragomirecký 3a131cfa0a Remove mentions of the -m32 flag (commented code) 2021-07-12 09:09:21 +02:00
Alan Dragomirecký c3f0e59d12 Remove the empty integration tests directory 2021-07-12 09:09:21 +02:00
Yuri D'Elia 9b77623be1 PulseGen: ensure Abort calculates the current remainder correctly
Instead of stepping halfway, step ~1/3 of the way through.

This ensures we can check if the steps performed is correct due to the
internal step subtraction.
2021-07-11 22:19:44 +02:00
Yuri D'Elia 9e935f6a07 Comment Typo 2021-07-11 22:17:04 +02:00
Yuri D'Elia 7337e97765 Rename Motion::DisableAxis to Disable
Implement Motion::SetEnabled (for symmetry with TMC2130::SetEnabled).

Rename DisableAxis to Disable and use the new SetEnabled. This makes the
member names more consistent.
2021-07-11 21:38:01 +02:00
Yuri D'Elia 066aab7adc Move cpuFrequencyDivider to config::stepTimerFrequencyDivider 2021-07-11 21:17:08 +02:00
Yuri D'Elia 0c47d8f0d1 PulseGen: add comprehensive tests (no acceleration yet) 2021-07-11 20:52:27 +02:00
Yuri D'Elia 5250cfd4fe Implement the SHR16::SetTMCDir stub for testing 2021-07-11 20:33:59 +02:00
Yuri D'Elia 1ff9b81630 Rename PulseGen::Move to PlanMoveTo
Make Motion and PulseGen intentionally very similar.
2021-07-07 16:59:40 +02:00
Yuri D'Elia 16cf02726b test_speed_table: improve static assertion
Test against the resulting timer speed, not against the CPU clock
2021-07-07 16:59:40 +02:00
Yuri D'Elia d87db1ff76 Revised WIP for the Motion API
- Remove the combined PlanMove(a,b,c,rate) call. If we allow the units
  of the various motors to be changed at compile time, the unit of
  rate can vary between axes.
- Build PlanMove on top of the absolute PlanMoveTo.
- Add required stubs for TMC2130.
- Allow each axis mode to be set independently, since we have this
  feature for free anyway.
- Rework internals to use PulseGen data types and structs.
2021-07-07 16:59:39 +02:00
Yuri D'Elia ed04bd02e2 PulseGen/speed_tables: cleanup constants 2021-07-07 16:59:04 +02:00
Yuri D'Elia 006dfd4abc PulseGen: remove all floating point calculations
Work in steps, steps/s, steps/s2 directly.
2021-07-07 16:59:04 +02:00
Yuri D'Elia cf5be5aade PulseGen: initial version of the ramp/pulse generator 2021-07-07 16:59:04 +02:00
Yuri D'Elia de88ed4c6b Add initial Axis configuration static structs 2021-07-07 16:59:04 +02:00
Yuri D'Elia ef7c776461 Update Motion for the new TMC2130/pins definitions 2021-07-07 16:59:04 +02:00
Yuri D'Elia 531f60ed27 Add modules::speed_table for acceleration lookup tables 2021-07-07 16:59:04 +02:00
Alan Dragomirecký 996f0f5dc0 Fix formatting of cmake files 2021-07-07 16:33:16 +02:00
Alan Dragomirecký 9448c04b36 Disable preprocessor code indentation 2021-07-07 16:33:03 +02:00
Yuri D'Elia 4362d77083 CircularIndex: alternate index management for full capacity
Comparing head/tail indexes cannot distinguish between empty/full cases,
so we end up wasting one item in the circular buffer. This also limits
the smallest and efficient size choice to be 4.

If the circular buffer is large, there's no issue, however for the
motion planner the block size is significant, and I was planning to use
exactly a ring buffer of two: one busy block, plus one planned.

Modify the indexer to store the internal "index" (aka cursor) pointer to
be one extra bit deeper than the final index. Comparing the underlying
cursor allow to distinguish the empty/full case due to the extra bit,
while producing the final index requires simple masking.

This is just as efficient if the size is a power of two with
2-complement wrap-around logic, which is the optimized case. However
the implementation also works for non-power-of-two sizes.

Add tests for more failure cases in the CircularBuffer which is built on
top.

(tecnique described in the Art of Computer Programming by Knuth)
2021-07-06 12:51:56 +02:00
D.R.racer 43a423f299 Change buttons' ADC limits into an array
as proposed by @vintagePC

cleaned-up some of the unit tests by this change
2021-07-05 18:07:54 +02:00
D.R.racer b484eeacb6 Start using config.h
Added some constexpr vars for buttons, finda, fsensor and
applied them in the FW and unit tests accordingly.
2021-07-05 18:07:54 +02:00
Yuri D'Elia 3ccfc3adfb GPIO: correctly stub known ports
- Use the correct port name in the #define
- Fully qualify all references
2021-07-05 15:20:11 +02:00
Yuri D'Elia 7c7aa95445 Mock GPIO when building tests
Add some conditional statements in gpio.h so that we can mock the GPIO
registers when building tests.
2021-07-05 15:20:11 +02:00
Yuri D'Elia ea8b335f8d progmem: fix for AVR
- Fix header name
- Rename pgm_read_word to read_word since pgm_read_word is a macro
  and cannot be scoped
2021-07-05 13:33:49 +02:00
Yuri D'Elia a9937b94e2 Add initial AVR PROGMEM abstraction in hal::progmem 2021-07-05 13:33:49 +02:00
D.R.racer 9efb127acb Explain and fix the LED states while cutting filament
now the test is correct including LEDs
2021-07-01 08:12:47 +02:00
D.R.racer d81b00a0f8 Test all filament slots 2021-07-01 08:12:47 +02:00
D.R.racer 974c1ba6db Verify Cut filament state machine + update unit tests 2021-07-01 07:03:39 +02:00
D.R.racer 75fe7b20b5 Verify and fix Tool Change state machine + unit tests 2021-07-01 07:03:02 +02:00
D.R.racer ffae941a28 Fix unit tests of load/unload filament 2021-06-30 07:39:31 +02:00
D.R.racer 9a8038ccb6 Add user_input module and use it instead of raw buttons
Encapsulates buttons and commands coming from the communication
2021-06-30 07:39:31 +02:00
D.R.racer c15b1d59c4 Introduce Doxyfile + fix modules documentation 2021-06-30 07:39:31 +02:00
D.R.racer f6e5d4ae76 Improve and verify Load filament alg and unit tests 2021-06-30 07:39:31 +02:00
D.R.racer 46a40f7488 Extend Unload filament unit tests
+ now error states are covered as well
+ greatly cleaned-up code
2021-06-30 07:39:31 +02:00
D.R.racer ce20f0b001 Greatly improve unload filament unit test
+ relevant changes for other unit tests -> prepare for improving
of the other unit tests as well
2021-06-30 07:39:31 +02:00
D.R.racer 807eda7db3 Add prototypes of remaining logic layer's unit tests
- load filament
- feed to bondtech
- tool change
2021-06-30 07:39:31 +02:00
D.R.racer f81ecf1294 Circular buffer - basic unit test 2021-06-29 12:17:10 +02:00
Yuri D'Elia 3cd94996e9 Remove invalid/useless test sizeof(ptr) == 4
This test is currently valid only for 32bit architectures.

There doesn't seem to be a true reason for this test to
ensure a pointer is exactly 4 bytes, so remove the test.
2021-06-29 08:59:36 +02:00
D.R.racer 4d6d6fe0af Add more checks (esp. positions of idler and selector)
that resulted in finding several weak spots and now Cut and Eject filament
do not pass the test (which is correct, they really have logical issues)
2021-06-21 10:28:56 +02:00
D.R.racer 317a486d1e Logic layer Eject filament unit tests
initial setup, it compiles, but is blocked by Unload filament
2021-06-21 10:26:04 +02:00
D.R.racer 1f8934c2c1 Fix+verify Cut filament unit test
it now finished ok, but future tweaks and improvements are expected
2021-06-21 10:22:17 +02:00
D.R.racer ede475c5a6 Introduce Timebase module, refactor timing code + unit tests 2021-06-21 10:22:17 +02:00
D.R.racer 398181e26c Feed to FINDA unit tests : green 2021-06-21 10:22:17 +02:00
D.R.racer d9b368bb92 Verify+fix second Feed to FINDA's unit test 2021-06-21 10:22:17 +02:00
D.R.racer 85910497f7 Unify buttons' API with other modules
- accepts millis() instead of doing the timing internally (which has
been a temporary solution just for the tests until now)
2021-06-21 10:22:17 +02:00
D.R.racer b338949acb Shorten ADC reinit usage 2021-06-21 10:22:17 +02:00
D.R.racer 3cb3cebed9 Add forced reinit of all automata for the unit tests
+ added a few constexpr to constructors on the way
2021-06-21 10:22:17 +02:00
D.R.racer b8f6bc9a4e Tune Feed to FINDA state machine and its unit test
so that it works as expected

Still, there is a task of resetting all of the state machines just for
the next unit test to be run.
2021-06-21 10:22:17 +02:00
D.R.racer f0a042c1b6 Add unit tests for Feed to FINDA state machine
+ improve infrastructure
2021-06-21 10:22:17 +02:00
D.R.racer 925201d77a Basic unit test structure for the logic layer
It compiles the Cut Filament unit test with all the necessary components.
Still, the unit test does nothing.
2021-06-21 10:22:17 +02:00
D.R.racer 019f74d6f2 Add debouncing for FINDA 2021-06-08 07:00:07 +02:00
D.R.racer bd335ec30d Unit test for LEDs interface + fixes 2021-05-26 11:39:24 +02:00
D.R.racer c377674aee Prepare unit tests for LEDs 2021-05-25 12:33:50 +02:00
D.R.racer 9226230fd5 Reformat sources to fit the new namespace formatting rules 2021-05-25 12:24:19 +02:00
D.R.racer fce2195558 Interface module for driving LEDs
+ start shaping up main.cpp
+ make the usage of namespaces and class names more consistent throughout the whole project
+ refactor related unit tests accordingly
2021-05-25 11:00:30 +02:00
D.R.racer 7611b98830 Add more unit tests and optimize (saved 1 byte per button on the AVR) 2021-05-25 10:02:02 +02:00
D.R.racer ba8eacfe33 Buttons module implementation
A module representing a model of the 3 buttons
Includes a unit test project (empty at this stage)
2021-05-25 10:02:02 +02:00
D.R.racer 6ebb281eda Update CMakeFiles.txt and temporarily fix compilation of unit tests 2021-05-18 08:58:23 +02:00
D.R.racer fe0ac4f9f9 More unit tests for decoding of response messages
+ related changes in code
2021-05-18 08:18:11 +02:00
D.R.racer 30fbf6d870 Unit tests for decoding requests and responses
+errors on requests
2021-05-18 08:18:11 +02:00
D.R.racer 0633dea881 Protocol implementation
+ unit tests for encoding of messages

API still subject to minor changes
2021-05-18 08:18:11 +02:00
D.R.racer 7eb346a54d Add first unit test
+proof of concept of Catch2 builds working in our repo
2021-05-13 17:35:08 +02:00
D.R.racer 257d0ec340 Prepare parts of the build system
extracted and slightly modified from Buddy-FW, still doesn't work
2021-04-19 07:03:47 +02:00