Prusa-MMU-Private
PrusaMultiMaterialUpgradev3firmwareforMK3SMK4
start_up.h
1 #pragma once
3 #include <stdint.h>
4 #include "command_base.h"
5 
6 namespace logic {
7 
9 class StartUp : public CommandBase {
10 public:
11  inline constexpr StartUp()
12  : CommandBase() {}
13 
15  bool Reset(uint8_t /*param*/) override;
16 
18  bool StepInner() override;
19 
23  inline void SetInitError(ErrorCode ec) {
24  error = ec;
25  state = ProgressCode::ERRWaitingForUser;
26  }
27 
28 private:
30  static bool CheckFINDAvsEEPROM();
31 };
32 
34 extern StartUp startUp;
35 
36 } // namespace logic
Base class defining common API for high-level operations/commands/state machines.
Definition: command_base.h:29
ProgressCode state
current progress state of the state machine
Definition: command_base.h:136
ErrorCode error
current error code
Definition: command_base.h:137
Firmware start up sequence with error handling & reporting.
Definition: start_up.h:9
bool StepInner() override
Definition: start_up.cpp:21
void SetInitError(ErrorCode ec)
Definition: start_up.h:23
bool Reset(uint8_t) override
Restart the automaton.
Definition: start_up.cpp:12
ErrorCode
Definition: error_codes.h:17
The logic namespace handles the application logic on top of the modules.
Definition: application.h:8
StartUp startUp
The one and only instance of StartUp state machine in the FW.
Definition: start_up.cpp:10