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

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