My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

ultralcd.h 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. #ifndef __ULTRALCDH
  2. #define __ULTRALCDH
  3. #include "Configuration.h"
  4. #ifdef ULTRA_LCD
  5. void lcd_status();
  6. void lcd_init();
  7. void lcd_status(const char* message);
  8. void beep();
  9. void buttons_check();
  10. #define LCD_UPDATE_INTERVAL 100
  11. #define STATUSTIMEOUT 15000
  12. #include <LiquidCrystal.h>
  13. extern LiquidCrystal lcd;
  14. #ifdef NEWPANEL
  15. #define EN_C (1<<BLEN_C)
  16. #define EN_B (1<<BLEN_B)
  17. #define EN_A (1<<BLEN_A)
  18. #define CLICKED (buttons&EN_C)
  19. #define BLOCK {blocking=millis()+blocktime;}
  20. #define CARDINSERTED (READ(SDCARDDETECT)==0)
  21. #else
  22. //atomatic, do not change
  23. #define B_LE (1<<BL_LE)
  24. #define B_UP (1<<BL_UP)
  25. #define B_MI (1<<BL_MI)
  26. #define B_DW (1<<BL_DW)
  27. #define B_RI (1<<BL_RI)
  28. #define B_ST (1<<BL_ST)
  29. #define EN_B (1<<BLEN_B)
  30. #define EN_A (1<<BLEN_A)
  31. #define CLICKED ((buttons&B_MI)||(buttons&B_ST))
  32. #define BLOCK {blocking[BL_MI]=millis()+blocktime;blocking[BL_ST]=millis()+blocktime;}
  33. #endif
  34. // blocking time for recognizing a new keypress of one key, ms
  35. #define blocktime 500
  36. #define lcdslow 5
  37. enum MainStatus{Main_Status, Main_Menu, Main_Prepare, Main_Control, Main_SD};
  38. class MainMenu{
  39. public:
  40. MainMenu();
  41. void update();
  42. uint8_t activeline;
  43. MainStatus status;
  44. uint8_t displayStartingRow;
  45. void showStatus();
  46. void showMainMenu();
  47. void showPrepare();
  48. void showControl();
  49. void showSD();
  50. bool force_lcd_update;
  51. int lastencoderpos;
  52. int8_t lineoffset;
  53. int8_t lastlineoffset;
  54. bool linechanging;
  55. };
  56. //conversion routines, could need some overworking
  57. char *fillto(int8_t n,char *c);
  58. char *ftostr51(const float &x);
  59. char *ftostr31(const float &x);
  60. char *ftostr3(const float &x);
  61. #define LCD_MESSAGE(x) lcd_status(x);
  62. #define LCD_MESSAGEPGM(x) lcd_statuspgm(PSTR(x));
  63. #define LCD_STATUS lcd_status()
  64. #else //no lcd
  65. #define LCD_STATUS
  66. #define LCD_MESSAGE(x)
  67. #define LCD_MESSAGEPGM(x)
  68. inline void lcd_status() {};
  69. #endif
  70. #ifndef ULTIPANEL
  71. #define CLICKED false
  72. #define BLOCK ;
  73. #endif
  74. #endif //ULTRALCD