My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

ultralcd.h 5.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  4. *
  5. * Based on Sprinter and grbl.
  6. * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #ifndef ULTRALCD_H
  23. #define ULTRALCD_H
  24. #include "Marlin.h"
  25. #if ENABLED(ULTRA_LCD)
  26. #include "buzzer.h"
  27. int lcd_strlen(const char* s);
  28. int lcd_strlen_P(const char* s);
  29. void lcd_update();
  30. void lcd_init();
  31. bool lcd_hasstatus();
  32. void lcd_setstatus(const char* message, const bool persist=false);
  33. void lcd_setstatuspgm(const char* message, const uint8_t level=0);
  34. void lcd_setalertstatuspgm(const char* message);
  35. void lcd_reset_alert_level();
  36. bool lcd_detected(void);
  37. #if ENABLED(LCD_USE_I2C_BUZZER)
  38. void lcd_buzz(long duration, uint16_t freq);
  39. #endif
  40. #if ENABLED(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0
  41. void dontExpireStatus();
  42. #endif
  43. #if ENABLED(DOGLCD)
  44. extern int lcd_contrast;
  45. void lcd_setcontrast(uint8_t value);
  46. #endif
  47. #define LCD_MESSAGEPGM(x) lcd_setstatuspgm(PSTR(x))
  48. #define LCD_ALERTMESSAGEPGM(x) lcd_setalertstatuspgm(PSTR(x))
  49. #define LCD_UPDATE_INTERVAL 100
  50. #define LCD_TIMEOUT_TO_STATUS 15000
  51. #if ENABLED(ULTIPANEL)
  52. void lcd_buttons_update();
  53. extern volatile uint8_t buttons; //the last checked buttons in a bit array.
  54. #if ENABLED(REPRAPWORLD_KEYPAD)
  55. extern volatile uint8_t buttons_reprapworld_keypad; // to store the keypad shift register values
  56. #endif
  57. #else
  58. FORCE_INLINE void lcd_buttons_update() {}
  59. #endif
  60. extern int plaPreheatHotendTemp;
  61. extern int plaPreheatHPBTemp;
  62. extern int plaPreheatFanSpeed;
  63. extern int absPreheatHotendTemp;
  64. extern int absPreheatHPBTemp;
  65. extern int absPreheatFanSpeed;
  66. extern bool cancel_heatup;
  67. extern uint8_t blink; // Variable for animation
  68. #if ENABLED(FILAMENT_LCD_DISPLAY)
  69. extern millis_t previous_lcd_status_ms;
  70. #endif
  71. void lcd_quick_feedback(); // Audible feedback for a button click - could also be visual
  72. bool lcd_clicked();
  73. void lcd_ignore_click(bool b=true);
  74. #if ENABLED(NEWPANEL)
  75. #define EN_C (_BV(BLEN_C))
  76. #define EN_B (_BV(BLEN_B))
  77. #define EN_A (_BV(BLEN_A))
  78. #if ENABLED(REPRAPWORLD_KEYPAD)
  79. #define EN_REPRAPWORLD_KEYPAD_F3 (_BV(BLEN_REPRAPWORLD_KEYPAD_F3))
  80. #define EN_REPRAPWORLD_KEYPAD_F2 (_BV(BLEN_REPRAPWORLD_KEYPAD_F2))
  81. #define EN_REPRAPWORLD_KEYPAD_F1 (_BV(BLEN_REPRAPWORLD_KEYPAD_F1))
  82. #define EN_REPRAPWORLD_KEYPAD_UP (_BV(BLEN_REPRAPWORLD_KEYPAD_UP))
  83. #define EN_REPRAPWORLD_KEYPAD_RIGHT (_BV(BLEN_REPRAPWORLD_KEYPAD_RIGHT))
  84. #define EN_REPRAPWORLD_KEYPAD_MIDDLE (_BV(BLEN_REPRAPWORLD_KEYPAD_MIDDLE))
  85. #define EN_REPRAPWORLD_KEYPAD_DOWN (_BV(BLEN_REPRAPWORLD_KEYPAD_DOWN))
  86. #define EN_REPRAPWORLD_KEYPAD_LEFT (_BV(BLEN_REPRAPWORLD_KEYPAD_LEFT))
  87. #define LCD_CLICKED ((buttons&EN_C) || (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F1))
  88. #define REPRAPWORLD_KEYPAD_MOVE_Z_UP (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F2)
  89. #define REPRAPWORLD_KEYPAD_MOVE_Z_DOWN (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F3)
  90. #define REPRAPWORLD_KEYPAD_MOVE_X_LEFT (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_LEFT)
  91. #define REPRAPWORLD_KEYPAD_MOVE_X_RIGHT (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_RIGHT)
  92. #define REPRAPWORLD_KEYPAD_MOVE_Y_DOWN (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_DOWN)
  93. #define REPRAPWORLD_KEYPAD_MOVE_Y_UP (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_UP)
  94. #define REPRAPWORLD_KEYPAD_MOVE_HOME (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_MIDDLE)
  95. #else
  96. #define LCD_CLICKED (buttons&EN_C)
  97. #endif //REPRAPWORLD_KEYPAD
  98. #else
  99. //atomic, do not change
  100. #define B_LE (_BV(BL_LE))
  101. #define B_UP (_BV(BL_UP))
  102. #define B_MI (_BV(BL_MI))
  103. #define B_DW (_BV(BL_DW))
  104. #define B_RI (_BV(BL_RI))
  105. #define B_ST (_BV(BL_ST))
  106. #define EN_B (_BV(BLEN_B))
  107. #define EN_A (_BV(BLEN_A))
  108. #define LCD_CLICKED ((buttons&B_MI)||(buttons&B_ST))
  109. #endif//NEWPANEL
  110. #else //no LCD
  111. FORCE_INLINE void lcd_update() {}
  112. FORCE_INLINE void lcd_init() {}
  113. FORCE_INLINE bool lcd_hasstatus() { return false; }
  114. FORCE_INLINE void lcd_setstatus(const char* message, const bool persist=false) {UNUSED(message); UNUSED(persist);}
  115. FORCE_INLINE void lcd_setstatuspgm(const char* message, const uint8_t level=0) {UNUSED(message); UNUSED(level);}
  116. FORCE_INLINE void lcd_buttons_update() {}
  117. FORCE_INLINE void lcd_reset_alert_level() {}
  118. FORCE_INLINE bool lcd_detected(void) { return true; }
  119. #define LCD_MESSAGEPGM(x) do{}while(0)
  120. #define LCD_ALERTMESSAGEPGM(x) do{}while(0)
  121. #endif //ULTRA_LCD
  122. char* itostr2(const uint8_t& x);
  123. char* itostr31(const int& xx);
  124. char* itostr3(const int& xx);
  125. char* itostr3left(const int& xx);
  126. char* itostr4(const int& xx);
  127. char* itostr4sign(const int& x);
  128. char* ftostr3(const float& x);
  129. char* ftostr4sign(const float& x);
  130. char* ftostr31ns(const float& x); // float to string without sign character
  131. char* ftostr31(const float& x);
  132. char* ftostr32(const float& x);
  133. char* ftostr43(const float& x);
  134. char* ftostr12ns(const float& x);
  135. char* ftostr32sp(const float& x); // remove zero-padding from ftostr32
  136. char* ftostr5(const float& x);
  137. char* ftostr51(const float& x);
  138. char* ftostr52(const float& x);
  139. #endif //ULTRALCD_H