My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

ultralcd.h 5.0KB

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