My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

ultralcd.h 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. #ifndef ULTRALCD_H
  2. #define ULTRALCD_H
  3. #include "Marlin.h"
  4. #ifdef ULTRA_LCD
  5. int lcd_strlen(char *s);
  6. int lcd_strlen_P(const char *s);
  7. void lcd_update();
  8. void lcd_init();
  9. void lcd_setstatus(const char* message, const bool persist=false);
  10. void lcd_setstatuspgm(const char* message, const uint8_t level=0);
  11. void lcd_setalertstatuspgm(const char* message);
  12. void lcd_reset_alert_level();
  13. bool lcd_detected(void);
  14. #if defined(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0
  15. void dontExpireStatus();
  16. #endif
  17. #ifdef DOGLCD
  18. extern int lcd_contrast;
  19. void lcd_setcontrast(uint8_t value);
  20. #endif
  21. #define LCD_MESSAGEPGM(x) lcd_setstatuspgm(PSTR(x))
  22. #define LCD_ALERTMESSAGEPGM(x) lcd_setalertstatuspgm(PSTR(x))
  23. #define LCD_UPDATE_INTERVAL 100
  24. #define LCD_TIMEOUT_TO_STATUS 15000
  25. #ifdef ULTIPANEL
  26. void lcd_buttons_update();
  27. extern volatile uint8_t buttons; //the last checked buttons in a bit array.
  28. #ifdef REPRAPWORLD_KEYPAD
  29. extern volatile uint8_t buttons_reprapworld_keypad; // to store the keypad shift register values
  30. #endif
  31. #else
  32. FORCE_INLINE void lcd_buttons_update() {}
  33. #endif
  34. extern int plaPreheatHotendTemp;
  35. extern int plaPreheatHPBTemp;
  36. extern int plaPreheatFanSpeed;
  37. extern int absPreheatHotendTemp;
  38. extern int absPreheatHPBTemp;
  39. extern int absPreheatFanSpeed;
  40. extern bool cancel_heatup;
  41. #ifdef FILAMENT_LCD_DISPLAY
  42. extern unsigned long message_millis;
  43. #endif
  44. void lcd_buzz(long duration,uint16_t freq);
  45. bool lcd_clicked();
  46. void lcd_ignore_click(bool b=true);
  47. #ifdef NEWPANEL
  48. #define EN_C BIT(BLEN_C)
  49. #define EN_B BIT(BLEN_B)
  50. #define EN_A BIT(BLEN_A)
  51. #define LCD_CLICKED (buttons&EN_C)
  52. #ifdef REPRAPWORLD_KEYPAD
  53. #define EN_REPRAPWORLD_KEYPAD_F3 BIT(BLEN_REPRAPWORLD_KEYPAD_F3)
  54. #define EN_REPRAPWORLD_KEYPAD_F2 BIT(BLEN_REPRAPWORLD_KEYPAD_F2)
  55. #define EN_REPRAPWORLD_KEYPAD_F1 BIT(BLEN_REPRAPWORLD_KEYPAD_F1)
  56. #define EN_REPRAPWORLD_KEYPAD_UP BIT(BLEN_REPRAPWORLD_KEYPAD_UP)
  57. #define EN_REPRAPWORLD_KEYPAD_RIGHT BIT(BLEN_REPRAPWORLD_KEYPAD_RIGHT)
  58. #define EN_REPRAPWORLD_KEYPAD_MIDDLE BIT(BLEN_REPRAPWORLD_KEYPAD_MIDDLE)
  59. #define EN_REPRAPWORLD_KEYPAD_DOWN BIT(BLEN_REPRAPWORLD_KEYPAD_DOWN)
  60. #define EN_REPRAPWORLD_KEYPAD_LEFT BIT(BLEN_REPRAPWORLD_KEYPAD_LEFT)
  61. #define LCD_CLICKED ((buttons&EN_C) || (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F1))
  62. #define REPRAPWORLD_KEYPAD_MOVE_Z_UP (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F2)
  63. #define REPRAPWORLD_KEYPAD_MOVE_Z_DOWN (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F3)
  64. #define REPRAPWORLD_KEYPAD_MOVE_X_LEFT (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_LEFT)
  65. #define REPRAPWORLD_KEYPAD_MOVE_X_RIGHT (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_RIGHT)
  66. #define REPRAPWORLD_KEYPAD_MOVE_Y_DOWN (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_DOWN)
  67. #define REPRAPWORLD_KEYPAD_MOVE_Y_UP (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_UP)
  68. #define REPRAPWORLD_KEYPAD_MOVE_HOME (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_MIDDLE)
  69. #endif //REPRAPWORLD_KEYPAD
  70. #else
  71. //atomic, do not change
  72. #define B_LE BIT(BL_LE)
  73. #define B_UP BIT(BL_UP)
  74. #define B_MI BIT(BL_MI)
  75. #define B_DW BIT(BL_DW)
  76. #define B_RI BIT(BL_RI)
  77. #define B_ST BIT(BL_ST)
  78. #define EN_B BIT(BLEN_B)
  79. #define EN_A BIT(BLEN_A)
  80. #define LCD_CLICKED ((buttons&B_MI)||(buttons&B_ST))
  81. #endif//NEWPANEL
  82. #else //no LCD
  83. FORCE_INLINE void lcd_update() {}
  84. FORCE_INLINE void lcd_init() {}
  85. FORCE_INLINE void lcd_setstatus(const char* message, const bool persist=false) {}
  86. FORCE_INLINE void lcd_setstatuspgm(const char* message, const uint8_t level=0) {}
  87. FORCE_INLINE void lcd_buttons_update() {}
  88. FORCE_INLINE void lcd_reset_alert_level() {}
  89. FORCE_INLINE void lcd_buzz(long duration,uint16_t freq) {}
  90. FORCE_INLINE bool lcd_detected(void) { return true; }
  91. #define LCD_MESSAGEPGM(x)
  92. #define LCD_ALERTMESSAGEPGM(x)
  93. #endif //ULTRA_LCD
  94. char *itostr2(const uint8_t &x);
  95. char *itostr31(const int &xx);
  96. char *itostr3(const int &xx);
  97. char *itostr3left(const int &xx);
  98. char *itostr4(const int &xx);
  99. char *ftostr3(const float &x);
  100. char *ftostr31ns(const float &x); // float to string without sign character
  101. char *ftostr31(const float &x);
  102. char *ftostr32(const float &x);
  103. char *ftostr43(const float &x);
  104. char *ftostr12ns(const float &x);
  105. char *ftostr32sp(const float &x); // remove zero-padding from ftostr32
  106. char *ftostr5(const float &x);
  107. char *ftostr51(const float &x);
  108. char *ftostr52(const float &x);
  109. #endif //ULTRALCD_H