mmu2_reporting.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /// @file mmu2_reporting.h
  2. #pragma once
  3. #include <stdint.h>
  4. namespace MMU2 {
  5. enum CommandInProgress : uint8_t {
  6. NoCommand = 0,
  7. CutFilament = 'C',
  8. EjectFilament = 'E',
  9. Homing = 'H',
  10. LoadFilament = 'L',
  11. Reset = 'X',
  12. ToolChange = 'T',
  13. UnloadFilament = 'U',
  14. };
  15. /// Called at the begin of every MMU operation
  16. void BeginReport(CommandInProgress cip, uint16_t ec);
  17. /// Called at the end of every MMU operation
  18. void EndReport(CommandInProgress cip, uint16_t ec);
  19. /**
  20. * @brief Called when the MMU or MK3S sends operation error (even repeatedly).
  21. * Render MMU error screen on the LCD. This must be non-blocking
  22. * and allow the MMU and printer to communicate with each other.
  23. * @param[in] ec error code
  24. */
  25. void ReportErrorHook(uint16_t ec);
  26. /// Called when the MMU sends operation progress update
  27. void ReportProgressHook(CommandInProgress cip, uint16_t ec);
  28. /// Remders the sensor status line. Also used by the "resume temperature" screen.
  29. void ReportErrorHookDynamicRender();
  30. /// Renders the static part of the sensor state line. Also used by "resuming temperature screen"
  31. void ReportErrorHookSensorLineRender();
  32. /// @returns true if the MMU is communicating and available
  33. /// can change at runtime
  34. bool MMUAvailable();
  35. /// Global Enable/Disable use MMU (to be stored in EEPROM)
  36. bool UseMMU();
  37. } // namespace