My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ultralcd.h 4.1KB

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