Prusa-MMU-Private
PrusaMultiMaterialUpgradev3firmwareforMK3SMK4
unload_to_finda.h
Go to the documentation of this file.
1 #pragma once
3 #include <stdint.h>
4 
5 namespace logic {
6 
14 struct UnloadToFinda {
16  enum {
17  EngagingIdler,
18  UnloadingToFinda,
19  WaitingForFINDA,
20  OK,
21  FailedFINDA,
22  FailedFSensor
23  };
24  inline constexpr UnloadToFinda()
25  : state(OK)
26  , maxTries(3)
27  , unloadStart_mm(0) {}
28 
31  void Reset(uint8_t maxTries);
32 
34  bool Step();
35 
37  inline uint8_t State() const { return state; }
38 
39 private:
40  uint8_t state;
41  uint8_t maxTries;
42  int32_t unloadStart_mm; // intentionally trying to avoid using U_mm because it is a float (reps. long double)
43 };
44 
45 } // namespace logic
The logic namespace handles the application logic on top of the modules.
Definition: application.h:8
Unload to FINDA "small" state machine.
Definition: unload_to_finda.h:14
uint8_t State() const
Definition: unload_to_finda.h:37
bool Step()
Definition: unload_to_finda.cpp:26
void Reset(uint8_t maxTries)
Definition: unload_to_finda.cpp:14