My Marlin configs for Fabrikator Mini and CTC i3 Pro B
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

ultralcd.h 4.7KB

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