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 3.8KB

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