buttons.h 801 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. #include <stdint.h>
  3. // Helper macros to parse the operations from Btns()
  4. #define BUTTON_OP_RIGHT(X) ( ( X & 0xF0 ) >> 4 )
  5. #define BUTTON_OP_MIDDLE(X) ( X & 0x0F )
  6. namespace MMU2 {
  7. /// Will be mapped onto dialog button responses in the FW
  8. /// Those responses have their unique+translated texts as well
  9. enum class ButtonOperations : uint8_t {
  10. NoOperation = 0,
  11. Retry = 1,
  12. Continue = 2,
  13. RestartMMU = 3,
  14. Unload = 4,
  15. StopPrint = 5,
  16. DisableMMU = 6,
  17. };
  18. /// Button codes + extended actions performed on the printer's side
  19. enum Buttons : uint8_t {
  20. Right = 0,
  21. Middle,
  22. Left,
  23. // performed on the printer's side
  24. RestartMMU,
  25. StopPrint,
  26. DisableMMU,
  27. NoButton = 0xff // shall be kept last
  28. };
  29. } // namespace MMU2