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.

interface_settings_screen.h 2.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*******************************
  2. * interface_settings_screen.h *
  3. *******************************/
  4. /****************************************************************************
  5. * Written By Mark Pelletier 2017 - Aleph Objects, Inc. *
  6. * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. *
  7. * *
  8. * This program is free software: you can redistribute it and/or modify *
  9. * it under the terms of the GNU General Public License as published by *
  10. * the Free Software Foundation, either version 3 of the License, or *
  11. * (at your option) any later version. *
  12. * *
  13. * This program is distributed in the hope that it will be useful, *
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of *
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  16. * GNU General Public License for more details. *
  17. * *
  18. * To view a copy of the GNU General Public License, go to the following *
  19. * location: <https://www.gnu.org/licenses/>. *
  20. ****************************************************************************/
  21. #pragma once
  22. #define FTDI_INTERFACE_SETTINGS_SCREEN
  23. #define FTDI_INTERFACE_SETTINGS_SCREEN_CLASS InterfaceSettingsScreen
  24. struct InterfaceSettingsScreenData {
  25. uint8_t volume;
  26. uint8_t brightness;
  27. };
  28. class InterfaceSettingsScreen : public BaseScreen, public CachedScreen<INTERFACE_SETTINGS_SCREEN_CACHE> {
  29. private:
  30. struct persistent_data_t {
  31. uint32_t touch_transform_a;
  32. uint32_t touch_transform_b;
  33. uint32_t touch_transform_c;
  34. uint32_t touch_transform_d;
  35. uint32_t touch_transform_e;
  36. uint32_t touch_transform_f;
  37. uint16_t passcode;
  38. uint8_t display_brightness;
  39. int8_t display_h_offset_adj;
  40. int8_t display_v_offset_adj;
  41. uint8_t sound_volume;
  42. uint8_t bit_flags;
  43. uint8_t event_sounds[InterfaceSoundsScreen::NUM_EVENTS];
  44. };
  45. public:
  46. #ifdef ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE
  47. static bool backupEEPROM();
  48. #endif
  49. static void saveSettings(char *);
  50. static void loadSettings(const char *);
  51. static void defaultSettings();
  52. static void failSafeSettings();
  53. static void onStartup();
  54. static void onEntry();
  55. static void onRedraw(draw_mode_t);
  56. static bool onTouchStart(uint8_t tag);
  57. static bool onTouchEnd(uint8_t tag);
  58. static void onIdle();
  59. };