S&B Volcano vaporizer remote control with Pi Pico W
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

state_settings.c 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * state_settings.c
  3. *
  4. * Copyright (c) 2023 Thomas Buck (thomas@xythobuz.de)
  5. *
  6. * This program is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * See <http://www.gnu.org/licenses/>.
  17. */
  18. #include <stdio.h>
  19. #include <string.h>
  20. #include "config.h"
  21. #include "log.h"
  22. #include "menu.h"
  23. #include "state.h"
  24. #include "state_settings.h"
  25. static void enter_cb(int selection) {
  26. switch (selection) {
  27. case 0:
  28. // Auto Connect
  29. }
  30. }
  31. static void exit_cb(void) {
  32. state_switch(STATE_SCAN);
  33. }
  34. void state_settings_enter(void) {
  35. menu_init(enter_cb, NULL, NULL, exit_cb);
  36. }
  37. void state_settings_exit(void) {
  38. menu_deinit();
  39. }
  40. static void draw(struct menu_state *menu) {
  41. int pos = 0;
  42. menu->length = 0;
  43. ADD_STATIC_ELEMENT("Auto Connect");
  44. ADD_STATIC_ELEMENT("Brightness");
  45. ADD_STATIC_ELEMENT("Workflows");
  46. if (menu->selection < 0) {
  47. menu->selection = 0;
  48. }
  49. }
  50. void state_settings_run(void) {
  51. menu_run(draw, false);
  52. }