mmu2_reporting.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. * @param[in] res reporter error source, is either Printer (0) or MMU (1)
  25. */
  26. void ReportErrorHook(uint16_t ec, uint8_t res);
  27. /// Called when the MMU sends operation progress update
  28. void ReportProgressHook(CommandInProgress cip, uint16_t ec);
  29. /// Remders the sensor status line. Also used by the "resume temperature" screen.
  30. void ReportErrorHookDynamicRender();
  31. /// Renders the static part of the sensor state line. Also used by "resuming temperature screen"
  32. void ReportErrorHookSensorLineRender();
  33. /// @returns true if the MMU is communicating and available
  34. /// can change at runtime
  35. bool MMUAvailable();
  36. /// Global Enable/Disable use MMU (to be stored in EEPROM)
  37. bool UseMMU();
  38. } // namespace