Prusa-MMU-Private
PrusaMultiMaterialUpgradev3firmwareforMK3SMK4
feed_to_bondtech.h
Go to the documentation of this file.
1 #pragma once
3 #include <stdint.h>
4 #include "../modules/axisunit.h"
5 
6 namespace logic {
7 
20  enum {
21  EngagingIdler,
22  PushingFilamentFast,
23  PushingFilamentToFSensor,
24  PushingFilamentIntoNozzle,
25  PartiallyDisengagingIdler,
26  DisengagingIdler,
27  OK,
28  Failed,
29  FSensorTooEarly,
30  // PulleyStalled
31  };
32 
33  inline constexpr FeedToBondtech()
34  : state(OK)
35  , maxRetries(1) {}
36 
38  void Reset(uint8_t maxRetries);
39 
41  bool Step();
42 
46  inline uint8_t State() const { return state; }
47 
51  void GoToPushToNozzle();
52 
53 private:
54  uint8_t state;
55  uint8_t maxRetries;
56 };
57 
58 } // namespace logic
The logic namespace handles the application logic on top of the modules.
Definition: application.h:8
Feed filament to Bondtech gears of the printer.
Definition: feed_to_bondtech.h:18
uint8_t State() const
Definition: feed_to_bondtech.h:46
void Reset(uint8_t maxRetries)
Restart the automaton.
Definition: feed_to_bondtech.cpp:16
bool Step()
Definition: feed_to_bondtech.cpp:32
void GoToPushToNozzle()
Definition: feed_to_bondtech.cpp:24