errors_list.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  1. // Extracted from Prusa-Error-Codes repo
  2. // Subject to automation and optimization
  3. // BEWARE - this file shall be included only into mmu2_error_converter.cpp, not anywhere else!
  4. #pragma once
  5. #include "inttypes.h"
  6. #include "../language.h"
  7. #include <avr/pgmspace.h>
  8. #include "buttons.h"
  9. namespace MMU2 {
  10. static constexpr uint8_t ERR_MMU_CODE = 4;
  11. typedef enum : uint16_t {
  12. ERR_UNDEF = 0,
  13. ERR_MECHANICAL = 100,
  14. ERR_MECHANICAL_FINDA_DIDNT_TRIGGER = 101,
  15. ERR_MECHANICAL_FINDA_DIDNT_GO_OFF = 102,
  16. ERR_MECHANICAL_FSENSOR_DIDNT_TRIGGER = 103,
  17. ERR_MECHANICAL_FSENSOR_DIDNT_GO_OFF = 104,
  18. ERR_MECHANICAL_PULLEY_CANNOT_MOVE = 105,
  19. ERR_MECHANICAL_FSENSOR_TOO_EARLY = 106,
  20. ERR_MECHANICAL_SELECTOR_CANNOT_HOME = 115,
  21. ERR_MECHANICAL_SELECTOR_CANNOT_MOVE = 116,
  22. ERR_MECHANICAL_IDLER_CANNOT_HOME = 125,
  23. ERR_MECHANICAL_IDLER_CANNOT_MOVE = 126,
  24. ERR_TEMPERATURE = 200,
  25. ERR_TEMPERATURE_PULLEY_WARNING_TMC_TOO_HOT = 201,
  26. ERR_TEMPERATURE_SELECTOR_WARNING_TMC_TOO_HOT = 211,
  27. ERR_TEMPERATURE_IDLER_WARNING_TMC_TOO_HOT = 221,
  28. ERR_TEMPERATURE_PULLEY_TMC_OVERHEAT_ERROR = 202,
  29. ERR_TEMPERATURE_SELECTOR_TMC_OVERHEAT_ERROR = 212,
  30. ERR_TEMPERATURE_IDLER_TMC_OVERHEAT_ERROR = 222,
  31. ERR_ELECTRICAL = 300,
  32. ERR_ELECTRICAL_PULLEY_TMC_DRIVER_ERROR = 301,
  33. ERR_ELECTRICAL_SELECTOR_TMC_DRIVER_ERROR = 311,
  34. ERR_ELECTRICAL_IDLER_TMC_DRIVER_ERROR = 321,
  35. ERR_ELECTRICAL_PULLEY_TMC_DRIVER_RESET = 302,
  36. ERR_ELECTRICAL_SELECTOR_TMC_DRIVER_RESET = 312,
  37. ERR_ELECTRICAL_IDLER_TMC_DRIVER_RESET = 322,
  38. ERR_ELECTRICAL_PULLEY_TMC_UNDERVOLTAGE_ERROR = 303,
  39. ERR_ELECTRICAL_SELECTOR_TMC_UNDERVOLTAGE_ERROR = 313,
  40. ERR_ELECTRICAL_IDLER_TMC_UNDERVOLTAGE_ERROR = 323,
  41. ERR_ELECTRICAL_PULLEY_TMC_DRIVER_SHORTED = 304,
  42. ERR_ELECTRICAL_SELECTOR_TMC_DRIVER_SHORTED = 314,
  43. ERR_ELECTRICAL_IDLER_TMC_DRIVER_SHORTED = 324,
  44. ERR_CONNECT = 400,
  45. ERR_CONNECT_MMU_NOT_RESPONDING = 401,
  46. ERR_CONNECT_COMMUNICATION_ERROR = 402,
  47. ERR_SYSTEM = 500,
  48. ERR_SYSTEM_FILAMENT_ALREADY_LOADED = 501,
  49. ERR_SYSTEM_INVALID_TOOL = 502,
  50. ERR_SYSTEM_QUEUE_FULL = 503,
  51. ERR_SYSTEM_FW_UPDATE_NEEDED = 504,
  52. ERR_SYSTEM_FW_RUNTIME_ERROR = 505,
  53. ERR_SYSTEM_UNLOAD_MANUALLY = 506,
  54. ERR_OTHER = 900
  55. } err_num_t;
  56. // Avr gcc has serious trouble understanding static data structures in PROGMEM
  57. // and inadvertedly falls back to copying the whole structure into RAM (which is obviously unwanted).
  58. // But since this file ought to be generated in the future from yaml prescription,
  59. // it really makes no difference if there are "nice" data structures or plain arrays.
  60. static const constexpr uint16_t errorCodes[] PROGMEM = {
  61. ERR_MECHANICAL_FINDA_DIDNT_TRIGGER,
  62. ERR_MECHANICAL_FINDA_DIDNT_GO_OFF,
  63. ERR_MECHANICAL_FSENSOR_DIDNT_TRIGGER,
  64. ERR_MECHANICAL_FSENSOR_DIDNT_GO_OFF,
  65. ERR_MECHANICAL_PULLEY_CANNOT_MOVE,
  66. ERR_MECHANICAL_FSENSOR_TOO_EARLY,
  67. ERR_MECHANICAL_SELECTOR_CANNOT_HOME,
  68. ERR_MECHANICAL_SELECTOR_CANNOT_MOVE,
  69. ERR_MECHANICAL_IDLER_CANNOT_HOME,
  70. ERR_MECHANICAL_IDLER_CANNOT_MOVE,
  71. ERR_TEMPERATURE_PULLEY_WARNING_TMC_TOO_HOT,
  72. ERR_TEMPERATURE_SELECTOR_WARNING_TMC_TOO_HOT,
  73. ERR_TEMPERATURE_IDLER_WARNING_TMC_TOO_HOT,
  74. ERR_TEMPERATURE_PULLEY_TMC_OVERHEAT_ERROR,
  75. ERR_TEMPERATURE_SELECTOR_TMC_OVERHEAT_ERROR,
  76. ERR_TEMPERATURE_IDLER_TMC_OVERHEAT_ERROR,
  77. ERR_ELECTRICAL_PULLEY_TMC_DRIVER_ERROR,
  78. ERR_ELECTRICAL_SELECTOR_TMC_DRIVER_ERROR,
  79. ERR_ELECTRICAL_IDLER_TMC_DRIVER_ERROR,
  80. ERR_ELECTRICAL_PULLEY_TMC_DRIVER_RESET,
  81. ERR_ELECTRICAL_SELECTOR_TMC_DRIVER_RESET,
  82. ERR_ELECTRICAL_IDLER_TMC_DRIVER_RESET,
  83. ERR_ELECTRICAL_PULLEY_TMC_UNDERVOLTAGE_ERROR,
  84. ERR_ELECTRICAL_SELECTOR_TMC_UNDERVOLTAGE_ERROR,
  85. ERR_ELECTRICAL_IDLER_TMC_UNDERVOLTAGE_ERROR,
  86. ERR_ELECTRICAL_PULLEY_TMC_DRIVER_SHORTED,
  87. ERR_ELECTRICAL_SELECTOR_TMC_DRIVER_SHORTED,
  88. ERR_ELECTRICAL_IDLER_TMC_DRIVER_SHORTED,
  89. ERR_CONNECT_MMU_NOT_RESPONDING,
  90. ERR_CONNECT_COMMUNICATION_ERROR,
  91. ERR_SYSTEM_FILAMENT_ALREADY_LOADED,
  92. ERR_SYSTEM_INVALID_TOOL,
  93. ERR_SYSTEM_QUEUE_FULL,
  94. ERR_SYSTEM_FW_UPDATE_NEEDED,
  95. ERR_SYSTEM_FW_RUNTIME_ERROR,
  96. ERR_SYSTEM_UNLOAD_MANUALLY
  97. };
  98. // @@TODO some of the strings are duplicates, can be merged into one 01234567890123456789
  99. static const char MSG_TITLE_FINDA_DIDNT_TRIGGER[] PROGMEM_I1 = ISTR("FINDA DIDNT TRIGGER"); ////MSG_TITLE_FINDA_DIDNT_TRIGGER c=20
  100. static const char MSG_TITLE_FINDA_DIDNT_GO_OFF[] PROGMEM_I1 = ISTR("FINDA: FILAM. STUCK"); ////MSG_TITLE_FINDA_DIDNT_GO_OFF c=20
  101. static const char MSG_TITLE_FSENSOR_DIDNT_TRIGGER[] PROGMEM_I1 = ISTR("FSENSOR DIDNT TRIGG."); ////MSG_TITLE_FSENSOR_DIDNT_TRIGGER c=20
  102. static const char MSG_TITLE_FSENSOR_DIDNT_GO_OFF[] PROGMEM_I1 = ISTR("FSENSOR: FIL. STUCK"); ////MSG_TITLE_FSENSOR_DIDNT_GO_OFF c=20
  103. static const char MSG_TITLE_PULLEY_CANNOT_MOVE[] PROGMEM_I1 = ISTR("PULLEY CANNOT MOVE"); ////MSG_TITLE_PULLEY_CANNOT_MOVE c=20
  104. static const char MSG_TITLE_FSENSOR_TOO_EARLY[] PROGMEM_I1 = ISTR("FSENSOR TOO EARLY"); ////MSG_TITLE_FSENSOR_TOO_EARLY c=20
  105. static const char MSG_TITLE_SELECTOR_CANNOT_MOVE[] PROGMEM_I1 = ISTR("SELECTOR CANNOT MOVE"); ////MSG_TITLE_SELECTOR_CANNOT_MOVE c=20
  106. static const char MSG_TITLE_SELECTOR_CANNOT_HOME[] PROGMEM_I1 = ISTR("SELECTOR CANNOT HOME"); ////MSG_TITLE_SELECTOR_CANNOT_HOME c=20
  107. static const char MSG_TITLE_IDLER_CANNOT_MOVE[] PROGMEM_I1 = ISTR("IDLER CANNOT MOVE"); ////MSG_TITLE_IDLER_CANNOT_MOVE c=20
  108. static const char MSG_TITLE_IDLER_CANNOT_HOME[] PROGMEM_I1 = ISTR("IDLER CANNOT HOME"); ////MSG_TITLE_IDLER_CANNOT_HOME c=20
  109. static const char MSG_TITLE_TMC_WARNING_TMC_TOO_HOT[] PROGMEM_I1 = ISTR("WARNING TMC TOO HOT"); ////MSG_TITLE_TMC_WARNING_TMC_TOO_HOT c=20
  110. //static const char MSG_TITLE_TMC_WARNING_TMC_TOO_HOT[] PROGMEM_I1 = ISTR("WARNING TMC TOO HOT"); ////MSG_TITLE_TMC_WARNING_TMC_TOO_HOT c=20
  111. //static const char MSG_TITLE_TMC_WARNING_TMC_TOO_HOT[] PROGMEM_I1 = ISTR("WARNING TMC TOO HOT");
  112. static const char MSG_TITLE_TMC_OVERHEAT_ERROR[] PROGMEM_I1 = ISTR("TMC OVERHEAT ERROR"); ////MSG_TITLE_TMC_OVERHEAT_ERROR c=20
  113. //static const char MSG_TITLE_TMC_OVERHEAT_ERROR[] PROGMEM_I1 = ISTR("TMC OVERHEAT ERROR");
  114. //static const char MSG_TITLE_TMC_OVERHEAT_ERROR[] PROGMEM_I1 = ISTR("TMC OVERHEAT ERROR");
  115. static const char MSG_TITLE_TMC_DRIVER_ERROR[] PROGMEM_I1 = ISTR("TMC DRIVER ERROR"); ////MSG_TITLE_TMC_DRIVER_ERROR c=20
  116. //static const char MSG_TITLE_TMC_DRIVER_ERROR[] PROGMEM_I1 = ISTR("TMC DRIVER ERROR");
  117. //static const char MSG_TITLE_TMC_DRIVER_ERROR[] PROGMEM_I1 = ISTR("TMC DRIVER ERROR");
  118. static const char MSG_TITLE_TMC_DRIVER_RESET[] PROGMEM_I1 = ISTR("TMC DRIVER RESET"); ////MSG_TITLE_TMC_DRIVER_RESET c=20
  119. //static const char MSG_TITLE_TMC_DRIVER_RESET[] PROGMEM_I1 = ISTR("TMC DRIVER RESET");
  120. //static const char MSG_TITLE_TMC_DRIVER_RESET[] PROGMEM_I1 = ISTR("TMC DRIVER RESET");
  121. static const char MSG_TITLE_TMC_UNDERVOLTAGE_ERROR[] PROGMEM_I1 = ISTR("TMC UNDERVOLTAGE ERR"); ////MSG_TITLE_TMC_UNDERVOLTAGE_ERROR c=20
  122. //static const char MSG_TITLE_TMC_UNDERVOLTAGE_ERROR[] PROGMEM_I1 = ISTR("TMC UNDERVOLTAGE ERR");
  123. //static const char MSG_TITLE_TMC_UNDERVOLTAGE_ERROR[] PROGMEM_I1 = ISTR("TMC UNDERVOLTAGE ERR");
  124. static const char MSG_TITLE_TMC_DRIVER_SHORTED[] PROGMEM_I1 = ISTR("TMC DRIVER SHORTED"); ////MSG_TITLE_TMC_DRIVER_SHORTED c=20
  125. //static const char MSG_TITLE_TMC_DRIVER_SHORTED[] PROGMEM_I1 = ISTR("TMC DRIVER SHORTED");
  126. //static const char MSG_TITLE_TMC_DRIVER_SHORTED[] PROGMEM_I1 = ISTR("TMC DRIVER SHORTED");
  127. static const char MSG_TITLE_MMU_NOT_RESPONDING[] PROGMEM_I1 = ISTR("MMU NOT RESPONDING"); ////MSG_TITLE_MMU_NOT_RESPONDING c=20
  128. static const char MSG_TITLE_COMMUNICATION_ERROR[] PROGMEM_I1 = ISTR("COMMUNICATION ERROR"); ////MSG_TITLE_COMMUNICATION_ERROR c=20
  129. static const char MSG_TITLE_FIL_ALREADY_LOADED[] PROGMEM_I1 = ISTR("FILAMENT ALREADY LOA"); ////MSG_TITLE_FIL_ALREADY_LOADED c=20
  130. static const char MSG_TITLE_INVALID_TOOL[] PROGMEM_I1 = ISTR("INVALID TOOL"); ////MSG_TITLE_INVALID_TOOL c=20
  131. static const char MSG_TITLE_QUEUE_FULL[] PROGMEM_I1 = ISTR("QUEUE FULL"); ////MSG_TITLE_QUEUE_FULL c=20
  132. static const char MSG_TITLE_FW_UPDATE_NEEDED[] PROGMEM_I1 = ISTR("MMU FW UPDATE NEEDED"); ////MSG_TITLE_FW_UPDATE_NEEDED c=20
  133. static const char MSG_TITLE_FW_RUNTIME_ERROR[] PROGMEM_I1 = ISTR("FW RUNTIME ERROR"); ////MSG_TITLE_FW_RUNTIME_ERROR c=20
  134. static const char MSG_TITLE_UNLOAD_MANUALLY[] PROGMEM_I1 = ISTR("UNLOAD MANUALLY"); ////MSG_TITLE_UNLOAD_MANUALLY c=20
  135. static const char * const errorTitles [] PROGMEM = {
  136. _R(MSG_TITLE_FINDA_DIDNT_TRIGGER),
  137. _R(MSG_TITLE_FINDA_DIDNT_GO_OFF),
  138. _R(MSG_TITLE_FSENSOR_DIDNT_TRIGGER),
  139. _R(MSG_TITLE_FSENSOR_DIDNT_GO_OFF),
  140. _R(MSG_TITLE_PULLEY_CANNOT_MOVE),
  141. _R(MSG_TITLE_FSENSOR_TOO_EARLY),
  142. _R(MSG_TITLE_SELECTOR_CANNOT_HOME),
  143. _R(MSG_TITLE_SELECTOR_CANNOT_MOVE),
  144. _R(MSG_TITLE_IDLER_CANNOT_HOME),
  145. _R(MSG_TITLE_IDLER_CANNOT_MOVE),
  146. _R(MSG_TITLE_TMC_WARNING_TMC_TOO_HOT),
  147. _R(MSG_TITLE_TMC_WARNING_TMC_TOO_HOT),
  148. _R(MSG_TITLE_TMC_WARNING_TMC_TOO_HOT),
  149. _R(MSG_TITLE_TMC_OVERHEAT_ERROR),
  150. _R(MSG_TITLE_TMC_OVERHEAT_ERROR),
  151. _R(MSG_TITLE_TMC_OVERHEAT_ERROR),
  152. _R(MSG_TITLE_TMC_DRIVER_ERROR),
  153. _R(MSG_TITLE_TMC_DRIVER_ERROR),
  154. _R(MSG_TITLE_TMC_DRIVER_ERROR),
  155. _R(MSG_TITLE_TMC_DRIVER_RESET),
  156. _R(MSG_TITLE_TMC_DRIVER_RESET),
  157. _R(MSG_TITLE_TMC_DRIVER_RESET),
  158. _R(MSG_TITLE_TMC_UNDERVOLTAGE_ERROR),
  159. _R(MSG_TITLE_TMC_UNDERVOLTAGE_ERROR),
  160. _R(MSG_TITLE_TMC_UNDERVOLTAGE_ERROR),
  161. _R(MSG_TITLE_TMC_DRIVER_SHORTED),
  162. _R(MSG_TITLE_TMC_DRIVER_SHORTED),
  163. _R(MSG_TITLE_TMC_DRIVER_SHORTED),
  164. _R(MSG_TITLE_MMU_NOT_RESPONDING),
  165. _R(MSG_TITLE_COMMUNICATION_ERROR),
  166. _R(MSG_TITLE_FIL_ALREADY_LOADED),
  167. _R(MSG_TITLE_INVALID_TOOL),
  168. _R(MSG_TITLE_QUEUE_FULL),
  169. _R(MSG_TITLE_FW_UPDATE_NEEDED),
  170. _R(MSG_TITLE_FW_RUNTIME_ERROR),
  171. _R(MSG_TITLE_UNLOAD_MANUALLY)
  172. };
  173. // @@TODO looking at the texts, they can be composed of several parts and/or parametrized (could save a lot of space ;) )
  174. // Moreover, some of them have been disabled in favour of saving some more code size.
  175. static const char MSG_DESC_FINDA_DIDNT_TRIGGER[] PROGMEM_I1 = ISTR("FINDA didn't trigger while loading the filament. Ensure the filament can move and FINDA works."); ////MSG_DESC_FINDA_DIDNT_TRIGGER c=20 r=8
  176. static const char MSG_DESC_FINDA_DIDNT_GO_OFF[] PROGMEM_I1 = ISTR("FINDA didn't switch off while unloading filament. Try unloading manually. Ensure filament can move and FINDA works."); ////MSG_DESC_FINDA_DIDNT_GO_OFF c=20 r=8
  177. static const char MSG_DESC_FSENSOR_DIDNT_TRIGGER[] PROGMEM_I1 = ISTR("Filament sensor didn't trigger while loading the filament. Ensure the filament reached the fsensor and the sensor works."); ////MSG_DESC_FSENSOR_DIDNT_TRIGGER c=20 r=8
  178. static const char MSG_DESC_FSENSOR_DIDNT_GO_OFF[] PROGMEM_I1 = ISTR("Filament sensor didn't switch off while unloading filament. Ensure filament can move and the sensor works."); ////MSG_DESC_FSENSOR_DIDNT_GO_OFF c=20 r=8
  179. static const char MSG_DESC_PULLEY_STALLED[] PROGMEM_I1 = ISTR("Pulley motor stalled. Ensure the pulley can move and check the wiring."); ////MSG_DESC_PULLEY_STALLED c=20 r=8
  180. static const char MSG_DESC_FSENSOR_TOO_EARLY[] PROGMEM_I1 = ISTR("Filament sensor triggered too early while loading to extruder. Check there isn't anything stuck in PTFE tube. Check that sensor reads properly."); ////MSG_DESC_FSENSOR_TOO_EARLY c=20 r=8
  181. static const char MSG_DESC_SELECTOR_CANNOT_HOME[] PROGMEM_I1 = ISTR("The Selector cannot home properly. Check for anything blocking its movement."); ////MSG_DESC_SELECTOR_CANNOT_HOME c=20 r=8
  182. static const char MSG_DESC_CANNOT_MOVE[] PROGMEM_I1 = ISTR("Can't move Selector or Idler."); /////MSG_DESC_CANNOT_MOVE c=20 r=4
  183. //static const char MSG_DESC_SELECTOR_CANNOT_MOVE[] PROGMEM_I1 = ISTR("The Selector cannot move. Check for anything blocking its movement. Check the wiring is correct.");
  184. static const char MSG_DESC_IDLER_CANNOT_HOME[] PROGMEM_I1 = ISTR("The Idler cannot home properly. Check for anything blocking its movement."); ////MSG_DESC_IDLER_CANNOT_HOME c=20 r=8
  185. //static const char MSG_DESC_IDLER_CANNOT_MOVE[] PROGMEM_I1 = ISTR("The Idler cannot move properly. Check for anything blocking its movement. Check the wiring is correct.");
  186. static const char MSG_DESC_TMC[] PROGMEM_I1 = ISTR("More details online."); ////MSG_DESC_TMC c=20 r=8
  187. //static const char MSG_DESC_PULLEY_WARNING_TMC_TOO_HOT[] PROGMEM_I1 = ISTR("TMC driver for the Pulley motor is almost overheating. Make sure there is sufficient airflow near the MMU board.");
  188. //static const char MSG_DESC_SELECTOR_WARNING_TMC_TOO_HOT[] PROGMEM_I1 = ISTR("TMC driver for the Selector motor is almost overheating. Make sure there is sufficient airflow near the MMU board.");
  189. //static const char MSG_DESC_IDLER_WARNING_TMC_TOO_HOT[] PROGMEM_I1 = ISTR("TMC driver for the Idler motor is almost overheating. Make sure there is sufficient airflow near the MMU board.");
  190. //static const char MSG_DESC_PULLEY_TMC_OVERHEAT_ERROR[] PROGMEM_I1 = ISTR("TMC driver for the Pulley motor is overheated. Cool down the MMU board and reset MMU.");
  191. //static const char MSG_DESC_SELECTOR_TMC_OVERHEAT_ERROR[] PROGMEM_I1 = ISTR("TMC driver for the Selector motor is overheated. Cool down the MMU board and reset MMU.");
  192. //static const char MSG_DESC_IDLER_TMC_OVERHEAT_ERROR[] PROGMEM_I1 = ISTR("TMC driver for the Idler motor is overheated. Cool down the MMU board and reset MMU.");
  193. //static const char MSG_DESC_PULLEY_TMC_DRIVER_ERROR[] PROGMEM_I1 = ISTR("TMC driver for the Pulley motor is not responding. Try resetting the MMU. If the issue persists contact support.");
  194. //static const char MSG_DESC_SELECTOR_TMC_DRIVER_ERROR[] PROGMEM_I1 = ISTR("TMC driver for the Selector motor is not responding. Try resetting the MMU. If the issue persists contact support.");
  195. //static const char MSG_DESC_IDLER_TMC_DRIVER_ERROR[] PROGMEM_I1 = ISTR("TMC driver for the Idler motor is not responding. Try resetting the MMU. If the issue persists contact support.");
  196. //static const char MSG_DESC_PULLEY_TMC_DRIVER_RESET[] PROGMEM_I1 = ISTR("TMC driver for the Pulley motor was restarted. There is probably an issue with the electronics. Check the wiring and connectors.");
  197. //static const char MSG_DESC_SELECTOR_TMC_DRIVER_RESET[] PROGMEM_I1 = ISTR("TMC driver for the Selector motor was restarted. There is probably an issue with the electronics. Check the wiring and connectors.");
  198. //static const char MSG_DESC_IDLER_TMC_DRIVER_RESET[] PROGMEM_I1 = ISTR("TMC driver for the Idler motor was restarted. There is probably an issue with the electronics. Check the wiring and connectors.");
  199. //static const char MSG_DESC_PULLEY_TMC_UNDERVOLTAGE_ERROR[] PROGMEM_I1 = ISTR("Not enough current for the Pulley TMC driver. There is probably an issue with the electronics. Check the wiring and connectors.");
  200. //static const char MSG_DESC_SELECTOR_TMC_UNDERVOLTAGE_ERROR[] PROGMEM_I1 = ISTR("Not enough current for the Selector TMC driver. There is probably an issue with the electronics. Check the wiring and connectors.");
  201. //static const char MSG_DESC_IDLER_TMC_UNDERVOLTAGE_ERROR[] PROGMEM_I1 = ISTR("Not enough current for the Idler TMC driver. There is probably an issue with the electronics. Check the wiring and connectors.");
  202. //static const char MSG_DESC_PULLEY_TMC_DRIVER_SHORTED[] PROGMEM_I1 = ISTR("Short circuit on the Pulley TMC driver. Check the wiring and connectors. If the issue persists contact support.");
  203. //static const char MSG_DESC_SELECTOR_TMC_DRIVER_SHORTED[] PROGMEM_I1 = ISTR("Short circuit on the Selector TMC driver. Check the wiring and connectors. If the issue persists contact support.");
  204. //static const char MSG_DESC_IDLER_TMC_DRIVER_SHORTED[] PROGMEM_I1 = ISTR("Short circuit on the Idler TMC driver. Check the wiring and connectors. If the issue persists contact support.");
  205. static const char MSG_DESC_MMU_NOT_RESPONDING[] PROGMEM_I1 = ISTR("MMU unit not responding. Check the wiring and connectors. If the issue persists, contact support."); ////MSG_DESC_MMU_NOT_RESPONDING c=20 r=8
  206. static const char MSG_DESC_COMMUNICATION_ERROR[] PROGMEM_I1 = ISTR("MMU unit not responding correctly. Check the wiring and connectors. If the issue persists, contact support."); ////MSG_DESC_COMMUNICATION_ERROR c=20 r=9
  207. static const char MSG_DESC_FILAMENT_ALREADY_LOADED[] PROGMEM_I1 = ISTR("Cannot perform the action, filament is already loaded. Unload it first."); ////MSG_DESC_FILAMENT_ALREADY_LOADED c=20 r=8
  208. static const char MSG_DESC_INVALID_TOOL[] PROGMEM_I1 = ISTR("Requested filament tool is not available on this hardware. Check the G-code for tool index out of range (T0-T4)."); ////MSG_DESC_INVALID_TOOL c=20 r=8
  209. static const char MSG_DESC_QUEUE_FULL[] PROGMEM_I1 = ISTR("MMU Firmware internal error, please reset the MMU."); ////MSG_DESC_QUEUE_FULL c=20 r=8
  210. static const char MSG_DESC_FW_UPDATE_NEEDED[] PROGMEM_I1 = ISTR("The MMU unit reports its FW version incompatible with the printer's firmware. Make sure the MMU firmware is up to date."); ////MSG_DESC_FW_UPDATE_NEEDED c=20 r=9
  211. static const char MSG_DESC_FW_RUNTIME_ERROR[] PROGMEM_I1 = ISTR("Internal runtime error. Try resetting the MMU unit or updating the firmware. If the issue persists, contact support."); ////MSG_DESC_FW_RUNTIME_ERROR c=20 r=11
  212. static const char MSG_DESC_UNLOAD_MANUALLY[] PROGMEM_I1 = ISTR("Unexpected FINDA reading. Ensure no filament is under FINDA and the selector is free. Check FINDA connection."); ////MSG_DESC_UNLOAD_MANUALLY c=20 r=8
  213. static const char * const errorDescs[] PROGMEM = {
  214. _R(MSG_DESC_FINDA_DIDNT_TRIGGER),
  215. _R(MSG_DESC_FINDA_DIDNT_GO_OFF),
  216. _R(MSG_DESC_FSENSOR_DIDNT_TRIGGER),
  217. _R(MSG_DESC_FSENSOR_DIDNT_GO_OFF),
  218. _R(MSG_DESC_PULLEY_STALLED),
  219. _R(MSG_DESC_FSENSOR_TOO_EARLY),
  220. _R(MSG_DESC_SELECTOR_CANNOT_HOME),
  221. _R(MSG_DESC_CANNOT_MOVE),
  222. _R(MSG_DESC_IDLER_CANNOT_HOME),
  223. _R(MSG_DESC_CANNOT_MOVE),
  224. _R(MSG_DESC_TMC), // descPULLEY_WARNING_TMC_TOO_HOT
  225. _R(MSG_DESC_TMC), // descSELECTOR_WARNING_TMC_TOO_HOT
  226. _R(MSG_DESC_TMC), // descIDLER_WARNING_TMC_TOO_HOT
  227. _R(MSG_DESC_TMC), // descPULLEY_TMC_OVERHEAT_ERROR
  228. _R(MSG_DESC_TMC), // descSELECTOR_TMC_OVERHEAT_ERROR
  229. _R(MSG_DESC_TMC), // descIDLER_TMC_OVERHEAT_ERROR
  230. _R(MSG_DESC_TMC), // descPULLEY_TMC_DRIVER_ERROR
  231. _R(MSG_DESC_TMC), // descSELECTOR_TMC_DRIVER_ERROR
  232. _R(MSG_DESC_TMC), // descIDLER_TMC_DRIVER_ERROR
  233. _R(MSG_DESC_TMC), // descPULLEY_TMC_DRIVER_RESET
  234. _R(MSG_DESC_TMC), // descSELECTOR_TMC_DRIVER_RESET
  235. _R(MSG_DESC_TMC), // descIDLER_TMC_DRIVER_RESET
  236. _R(MSG_DESC_TMC), // descPULLEY_TMC_UNDERVOLTAGE_ERROR
  237. _R(MSG_DESC_TMC), // descSELECTOR_TMC_UNDERVOLTAGE_ERROR
  238. _R(MSG_DESC_TMC), // descIDLER_TMC_UNDERVOLTAGE_ERROR
  239. _R(MSG_DESC_TMC), // descPULLEY_TMC_DRIVER_SHORTED
  240. _R(MSG_DESC_TMC), // descSELECTOR_TMC_DRIVER_SHORTED
  241. _R(MSG_DESC_TMC), // descIDLER_TMC_DRIVER_SHORTED
  242. _R(MSG_DESC_MMU_NOT_RESPONDING),
  243. _R(MSG_DESC_COMMUNICATION_ERROR),
  244. _R(MSG_DESC_FILAMENT_ALREADY_LOADED),
  245. _R(MSG_DESC_INVALID_TOOL),
  246. _R(MSG_DESC_QUEUE_FULL),
  247. _R(MSG_DESC_FW_UPDATE_NEEDED),
  248. _R(MSG_DESC_FW_RUNTIME_ERROR),
  249. _R(MSG_DESC_UNLOAD_MANUALLY)
  250. };
  251. // we have max 3 buttons/operations to select from
  252. // one of them is "More" to show the explanation text normally hidden in the next screens.
  253. // 01234567890123456789
  254. // >bttxt >bttxt>MoreW
  255. // Therefore at least some of the buttons, which can occur on the screen together, need to be 5-chars long max @@TODO.
  256. // Beware - we only have space for 2 buttons on the LCD while the MMU has 3 buttons
  257. // -> the left button on the MMU is not used/rendered on the LCD (it is also almost unused on the MMU side)
  258. static const char MSG_BTN_RETRY[] PROGMEM_I1 = ISTR("Retry"); ////MSG_BTN_RETRY c=5
  259. static const char MSG_BTN_CONTINUE[] PROGMEM_I1 = ISTR("Done"); ////MSG_BTN_CONTINUE c=5
  260. static const char MSG_BTN_RESTART_MMU[] PROGMEM_I1 = ISTR("Reset MMU"); ////MSG_BTN_RESTART_MMU c=9
  261. static const char MSG_BTN_UNLOAD[] PROGMEM_I1 = ISTR("Unload"); ////MSG_BTN_UNLOAD c=6
  262. static const char MSG_BTN_STOP[] PROGMEM_I1 = ISTR("Stop"); ////MSG_BTN_STOP c=5
  263. static const char MSG_BTN_DISABLE_MMU[] PROGMEM_I1 = ISTR("Disable"); ////MSG_BTN_DISABLE_MMU c=9
  264. static const char MSG_BTN_MORE[] PROGMEM_I1 = ISTR("More\x06"); ////MSG_BTN_MORE c=5
  265. // Used to parse the buttons from Btns().
  266. static const char * const btnOperation[] PROGMEM = {
  267. _R(MSG_BTN_RETRY),
  268. _R(MSG_BTN_CONTINUE),
  269. _R(MSG_BTN_RESTART_MMU),
  270. _R(MSG_BTN_UNLOAD),
  271. _R(MSG_BTN_STOP),
  272. _R(MSG_BTN_DISABLE_MMU),
  273. };
  274. // We have 8 different operations/buttons at this time, so we need at least 4 bits to encode each.
  275. // Since one of the buttons is always "More", we can skip that one.
  276. // Therefore we need just 1 byte to describe the necessary buttons for each screen.
  277. uint8_t constexpr Btns(ButtonOperations bMiddle, ButtonOperations bRight){
  278. return ((uint8_t)bRight) << 4 | ((uint8_t)bMiddle);
  279. }
  280. static const uint8_t errorButtons[] PROGMEM = {
  281. Btns(ButtonOperations::Retry, ButtonOperations::Continue),//FINDA_DIDNT_TRIGGER
  282. Btns(ButtonOperations::Retry, ButtonOperations::Continue),//FINDA_DIDNT_GO_OFF
  283. Btns(ButtonOperations::Retry, ButtonOperations::NoOperation),//FSENSOR_DIDNT_TRIGGER
  284. Btns(ButtonOperations::Retry, ButtonOperations::NoOperation),//FSENSOR_DIDNT_GO_OFF
  285. Btns(ButtonOperations::Retry, ButtonOperations::NoOperation),//PULLEY_STALLED
  286. Btns(ButtonOperations::Retry, ButtonOperations::NoOperation),//FSENSOR_TOO_EARLY
  287. Btns(ButtonOperations::Retry, ButtonOperations::NoOperation),//SELECTOR_CANNOT_HOME
  288. Btns(ButtonOperations::Retry, ButtonOperations::NoOperation),//SELECTOR_CANNOT_MOVE
  289. Btns(ButtonOperations::Retry, ButtonOperations::NoOperation),//IDLER_CANNOT_HOME
  290. Btns(ButtonOperations::Retry, ButtonOperations::NoOperation),//IDLER_CANNOT_MOVE
  291. Btns(ButtonOperations::Continue, ButtonOperations::RestartMMU),//PULLEY_WARNING_TMC_TOO_HOT
  292. Btns(ButtonOperations::Continue, ButtonOperations::RestartMMU),//SELECTOR_WARNING_TMC_TOO_HOT
  293. Btns(ButtonOperations::Continue, ButtonOperations::RestartMMU),//IDLER_WARNING_TMC_TOO_HOT
  294. Btns(ButtonOperations::RestartMMU, ButtonOperations::NoOperation),//PULLEY_TMC_OVERHEAT_ERROR
  295. Btns(ButtonOperations::RestartMMU, ButtonOperations::NoOperation),//SELECTOR_TMC_OVERHEAT_ERROR
  296. Btns(ButtonOperations::RestartMMU, ButtonOperations::NoOperation),//IDLER_TMC_OVERHEAT_ERROR
  297. Btns(ButtonOperations::RestartMMU, ButtonOperations::NoOperation),//PULLEY_TMC_DRIVER_ERROR
  298. Btns(ButtonOperations::RestartMMU, ButtonOperations::NoOperation),//SELECTOR_TMC_DRIVER_ERROR
  299. Btns(ButtonOperations::RestartMMU, ButtonOperations::NoOperation),//IDLER_TMC_DRIVER_ERROR
  300. Btns(ButtonOperations::RestartMMU, ButtonOperations::NoOperation),//PULLEY_TMC_DRIVER_RESET
  301. Btns(ButtonOperations::RestartMMU, ButtonOperations::NoOperation),//SELECTOR_TMC_DRIVER_RESET
  302. Btns(ButtonOperations::RestartMMU, ButtonOperations::NoOperation),//IDLER_TMC_DRIVER_RESET
  303. Btns(ButtonOperations::RestartMMU, ButtonOperations::NoOperation),//PULLEY_TMC_UNDERVOLTAGE_ERROR
  304. Btns(ButtonOperations::RestartMMU, ButtonOperations::NoOperation),//SELECTOR_TMC_UNDERVOLTAGE_ERROR
  305. Btns(ButtonOperations::RestartMMU, ButtonOperations::NoOperation),//IDLER_TMC_UNDERVOLTAGE_ERROR
  306. Btns(ButtonOperations::RestartMMU, ButtonOperations::NoOperation),//PULLEY_TMC_DRIVER_SHORTED
  307. Btns(ButtonOperations::RestartMMU, ButtonOperations::NoOperation),//SELECTOR_TMC_DRIVER_SHORTED
  308. Btns(ButtonOperations::RestartMMU, ButtonOperations::NoOperation),//IDLER_TMC_DRIVER_SHORTED
  309. Btns(ButtonOperations::RestartMMU, ButtonOperations::NoOperation),//MMU_NOT_RESPONDING
  310. Btns(ButtonOperations::RestartMMU, ButtonOperations::NoOperation),//COMMUNICATION_ERROR
  311. Btns(ButtonOperations::Unload, ButtonOperations::Continue),//FILAMENT_ALREADY_LOADED
  312. Btns(ButtonOperations::StopPrint, ButtonOperations::RestartMMU),//INVALID_TOOL
  313. Btns(ButtonOperations::RestartMMU, ButtonOperations::NoOperation),//QUEUE_FULL
  314. Btns(ButtonOperations::DisableMMU, ButtonOperations::NoOperation),//FW_UPDATE_NEEDED
  315. Btns(ButtonOperations::RestartMMU, ButtonOperations::NoOperation),//FW_RUNTIME_ERROR
  316. Btns(ButtonOperations::Retry, ButtonOperations::NoOperation),//UNLOAD_MANUALLY
  317. };
  318. static_assert( sizeof(errorCodes) / sizeof(errorCodes[0]) == sizeof(errorDescs) / sizeof (errorDescs[0]));
  319. static_assert( sizeof(errorCodes) / sizeof(errorCodes[0]) == sizeof(errorTitles) / sizeof (errorTitles[0]));
  320. static_assert( sizeof(errorCodes) / sizeof(errorCodes[0]) == sizeof(errorButtons) / sizeof (errorButtons[0]));
  321. } // namespace MMU2