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.

53 lines
1.2 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. #include "camera.h"
  2. //
  3. extern "C"
  4. {
  5. #include "ble_spp_server_demo.h"
  6. #include "light.h"
  7. #include "key.h"
  8. #include "wifi.h"
  9. }
  10. power_state_light_structer_t power_state_light_structer = {
  11. .state = ShutDown,
  12. .change_flag = false,
  13. };
  14. heating_state_light_structer_t heating_state_light_structer = {
  15. .state = NoHeat,
  16. .change_flag = false,
  17. };
  18. reaction_state_light_structer_t reaction_state_light_structer = {
  19. .state = NoReaction,
  20. .change_flag = false,
  21. };
  22. wifi_state_light_structer_t wifi_state_light_structer = {
  23. .state = NotConnected,
  24. .change_flag = false,
  25. };
  26. static void T_all_light_init(void)
  27. {
  28. T_power_light_init(&power_state_light_structer);
  29. T_heating_state_light_init(&heating_state_light_structer);
  30. T_reaction_state_light_init(&reaction_state_light_structer);
  31. T_wifi_state_light_init(&wifi_state_light_structer);
  32. }
  33. extern "C" void app_main(void)
  34. {
  35. T_debug_light_init();
  36. T_all_light_init();
  37. ble_spp_server_init();
  38. camera_init();
  39. key_init();
  40. wifi_init();
  41. key_registered_cb();
  42. wifi_registered_cb();
  43. while (true)
  44. {
  45. T_debug_light_schedule();
  46. T_light_schedule();
  47. key_schedule();
  48. }
  49. }