mmu2_reporting.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. /// Increments EEPROM cell - number of failed loads into the nozzle
  38. /// Note: technically, this is not an MMU error but an error of the printer.
  39. void IncrementLoadFails();
  40. /// Increments EEPROM cell - number of MMU errors
  41. void IncrementMMUFails();
  42. } // namespace