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.

63 lines
2.1 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
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. #include "heating_plate.h"
  10. }
  11. /***********************************************************************************************************************
  12. * *******************************************************light******************************************************* *
  13. ***********************************************************************************************************************/
  14. power_state_light_structer_t power_state_light_structer = {
  15. .state = ShutDown,
  16. .change_flag = false,
  17. };
  18. heating_plate_state_light_structer_t heating_plate_state_light_structer = {
  19. .state = NoHeat,
  20. .change_flag = false,
  21. };
  22. reaction_state_light_structer_t reaction_state_light_structer = {
  23. .state = NoReaction,
  24. .change_flag = false,
  25. };
  26. wifi_state_light_structer_t wifi_state_light_structer = {
  27. .state = NotConnected,
  28. .change_flag = false,
  29. };
  30. /***********************************************************************************************************************
  31. * ********************************************************key******************************************************** *
  32. ***********************************************************************************************************************/
  33. T_key_structer_t T_key_structer = {
  34. .key_before_state = false,
  35. .key_now_state = false,
  36. };
  37. static void T_all_light_init(void)
  38. {
  39. T_power_light_init(&power_state_light_structer);
  40. T_heating_plate_state_light_init(&heating_plate_state_light_structer);
  41. T_reaction_state_light_init(&reaction_state_light_structer);
  42. T_wifi_state_light_init(&wifi_state_light_structer);
  43. }
  44. extern "C" void app_main(void)
  45. {
  46. T_debug_light_init();
  47. T_all_light_init();
  48. ble_spp_server_init();
  49. camera_init();
  50. T_key_init(&T_key_structer);
  51. T_wifi_init();
  52. T_key_registered_cb(camera_recognition_reaction_plate);
  53. T_wifi_registered_cb();
  54. while (true)
  55. {
  56. T_debug_light_schedule();
  57. T_key_schedule();
  58. }
  59. }