Prusa-MMU-Private
PrusaMultiMaterialUpgradev3firmwareforMK3SMK4
fsensor.h
Go to the documentation of this file.
1 #pragma once
3 #include <stdint.h>
4 #include "debouncer.h"
5 #include "../config/config.h"
6 
7 namespace modules {
8 
10 namespace fsensor {
11 
14 class FSensor : protected debounce::Debouncer {
15 public:
16  inline constexpr FSensor()
17  : debounce::Debouncer(config::fsensorDebounceMs)
18  , reportedFSensorState(false) {};
19 
21  void Step();
22 
24 
26  void ProcessMessage(bool on);
27 
28 private:
29  bool reportedFSensorState;
30 };
31 
33 extern FSensor fsensor;
34 
35 } // namespace fsensor
36 } // namespace modules
37 
38 namespace mfs = modules::fsensor;
Definition: debouncer.h:12
bool Pressed() const
Definition: debouncer.h:21
Definition: fsensor.h:14
void ProcessMessage(bool on)
Records a change of state of filament sensor when arrived via communication.
Definition: fsensor.cpp:14
void Step()
Performs one step of the state machine - processes a change-of-state message if any arrived.
Definition: fsensor.cpp:10
The fsensor namespace provides all necessary facilities related to the logical model of the printer's...
Definition: fsensor.cpp:6
FSensor fsensor
The one and only instance of printer's filament sensor in the FW.
Definition: fsensor.cpp:8
The modules namespace contains models of MMU's components.
Definition: command_base.h:8