My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

ultralcd.h 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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 visualisation 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 shiftregister 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. void lcd_buzz(long duration,uint16_t freq);
  36. bool lcd_clicked();
  37. #ifdef NEWPANEL
  38. #define EN_C (1<<BLEN_C)
  39. #define EN_B (1<<BLEN_B)
  40. #define EN_A (1<<BLEN_A)
  41. #define LCD_CLICKED (buttons&EN_C)
  42. #ifdef REPRAPWORLD_KEYPAD
  43. #define EN_REPRAPWORLD_KEYPAD_F3 (1<<BLEN_REPRAPWORLD_KEYPAD_F3)
  44. #define EN_REPRAPWORLD_KEYPAD_F2 (1<<BLEN_REPRAPWORLD_KEYPAD_F2)
  45. #define EN_REPRAPWORLD_KEYPAD_F1 (1<<BLEN_REPRAPWORLD_KEYPAD_F1)
  46. #define EN_REPRAPWORLD_KEYPAD_UP (1<<BLEN_REPRAPWORLD_KEYPAD_UP)
  47. #define EN_REPRAPWORLD_KEYPAD_RIGHT (1<<BLEN_REPRAPWORLD_KEYPAD_RIGHT)
  48. #define EN_REPRAPWORLD_KEYPAD_MIDDLE (1<<BLEN_REPRAPWORLD_KEYPAD_MIDDLE)
  49. #define EN_REPRAPWORLD_KEYPAD_DOWN (1<<BLEN_REPRAPWORLD_KEYPAD_DOWN)
  50. #define EN_REPRAPWORLD_KEYPAD_LEFT (1<<BLEN_REPRAPWORLD_KEYPAD_LEFT)
  51. #define LCD_CLICKED ((buttons&EN_C) || (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F1))
  52. #define REPRAPWORLD_KEYPAD_MOVE_Z_UP (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F2)
  53. #define REPRAPWORLD_KEYPAD_MOVE_Z_DOWN (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F3)
  54. #define REPRAPWORLD_KEYPAD_MOVE_X_LEFT (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_LEFT)
  55. #define REPRAPWORLD_KEYPAD_MOVE_X_RIGHT (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_RIGHT)
  56. #define REPRAPWORLD_KEYPAD_MOVE_Y_DOWN (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_DOWN)
  57. #define REPRAPWORLD_KEYPAD_MOVE_Y_UP (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_UP)
  58. #define REPRAPWORLD_KEYPAD_MOVE_HOME (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_MIDDLE)
  59. #endif //REPRAPWORLD_KEYPAD
  60. #else
  61. //atomatic, do not change
  62. #define B_LE (1<<BL_LE)
  63. #define B_UP (1<<BL_UP)
  64. #define B_MI (1<<BL_MI)
  65. #define B_DW (1<<BL_DW)
  66. #define B_RI (1<<BL_RI)
  67. #define B_ST (1<<BL_ST)
  68. #define EN_B (1<<BLEN_B)
  69. #define EN_A (1<<BLEN_A)
  70. #define LCD_CLICKED ((buttons&B_MI)||(buttons&B_ST))
  71. #endif//NEWPANEL
  72. #else //no lcd
  73. FORCE_INLINE void lcd_update() {}
  74. FORCE_INLINE void lcd_init() {}
  75. FORCE_INLINE void lcd_setstatus(const char* message) {}
  76. FORCE_INLINE void lcd_buttons_update() {}
  77. FORCE_INLINE void lcd_reset_alert_level() {}
  78. FORCE_INLINE void lcd_buzz(long duration,uint16_t freq) {}
  79. #define LCD_MESSAGEPGM(x)
  80. #define LCD_ALERTMESSAGEPGM(x)
  81. #endif
  82. char *itostr2(const uint8_t &x);
  83. char *itostr31(const int &xx);
  84. char *itostr3(const int &xx);
  85. char *itostr3left(const int &xx);
  86. char *itostr4(const int &xx);
  87. char *ftostr3(const float &x);
  88. char *ftostr31ns(const float &x); // float to string without sign character
  89. char *ftostr31(const float &x);
  90. char *ftostr32(const float &x);
  91. char *ftostr5(const float &x);
  92. char *ftostr51(const float &x);
  93. char *ftostr52(const float &x);
  94. #endif //ULTRALCD