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.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. void getfilename(const uint8_t nr);
  43. uint8_t activeline;
  44. MainStatus status;
  45. uint8_t displayStartingRow;
  46. void showStatus();
  47. void showMainMenu();
  48. void showPrepare();
  49. void showControl();
  50. void showSD();
  51. bool force_lcd_update;
  52. int lastencoderpos;
  53. int8_t lineoffset;
  54. int8_t lastlineoffset;
  55. char filename[11];
  56. bool linechanging;
  57. };
  58. //conversion routines, could need some overworking
  59. char *fillto(int8_t n,char *c);
  60. char *ftostr51(const float &x);
  61. char *ftostr31(const float &x);
  62. char *ftostr3(const float &x);
  63. #define LCD_MESSAGE(x) lcd_status(x);
  64. #define LCD_STATUS lcd_status()
  65. #else //no lcd
  66. #define LCD_STATUS
  67. #define LCD_MESSAGE(x)
  68. inline void lcd_status() {};
  69. #endif
  70. #ifndef ULTIPANEL
  71. #define CLICKED false
  72. #define BLOCK ;
  73. #endif
  74. #endif //ULTRALCD