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.
64 lines
2.1 KiB
64 lines
2.1 KiB
#include "camera.h"
|
|
//
|
|
extern "C"
|
|
{
|
|
#include "ble_spp_server_demo.h"
|
|
#include "light.h"
|
|
#include "key.h"
|
|
#include "wifi.h"
|
|
#include "heating_plate.h"
|
|
}
|
|
/***********************************************************************************************************************
|
|
* *******************************************************light******************************************************* *
|
|
***********************************************************************************************************************/
|
|
power_state_light_structer_t power_state_light_structer = {
|
|
.state = ShutDown,
|
|
.change_flag = false,
|
|
};
|
|
heating_plate_state_light_structer_t heating_plate_state_light_structer = {
|
|
.state = NoHeat,
|
|
.change_flag = false,
|
|
};
|
|
reaction_state_light_structer_t reaction_state_light_structer = {
|
|
.state = NoReaction,
|
|
.change_flag = false,
|
|
};
|
|
wifi_state_light_structer_t wifi_state_light_structer = {
|
|
.state = NotConnected,
|
|
.change_flag = false,
|
|
};
|
|
|
|
/***********************************************************************************************************************
|
|
* ********************************************************key******************************************************** *
|
|
***********************************************************************************************************************/
|
|
T_key_structer_t T_key_structer = {
|
|
.key_before_state = false,
|
|
.key_now_state = false,
|
|
};
|
|
|
|
static void T_all_light_init(void)
|
|
{
|
|
T_power_light_init(&power_state_light_structer);
|
|
T_heating_plate_state_light_init(&heating_plate_state_light_structer);
|
|
T_reaction_state_light_init(&reaction_state_light_structer);
|
|
T_wifi_state_light_init(&wifi_state_light_structer);
|
|
}
|
|
|
|
extern "C" void app_main(void)
|
|
{
|
|
T_debug_light_init();
|
|
T_all_light_init();
|
|
ble_spp_server_init();
|
|
camera_init();
|
|
T_key_init(&T_key_structer);
|
|
T_wifi_init();
|
|
|
|
T_key_registered_cb(camera_recognition_reaction_plate);
|
|
T_wifi_registered_cb();
|
|
|
|
while (true)
|
|
{
|
|
T_debug_light_schedule();
|
|
T_key_schedule();
|
|
}
|
|
}
|