/** * @file heating_plate.c * @author Finny (tianjialong0106@163.com) * @brief * @version 0.1 * @date 2022-09-26 * * @copyright Copyright (c) 2022 * */ #include "heating_plate.h" #define heating_plate_target_temp 48.0 #define heating_plate_variable_temperature_range 0.5 static heating_plate_structer_t *heating_plate_structer_s; static get_temp_callback_t get_temp_cb_s; void T_heating_plate_init(heating_plate_structer_t *heating_plate_structer) { heating_plate_structer_s = heating_plate_structer; } void T_heating_plate_registered_cb(get_temp_callback_t cb) { get_temp_cb_s = cb; } void T_heating_plate_start(void) {} void T_heating_plate_stop(void) {} void T_heating_plate_schedule(void) { if (heating_plate_structer_s->heating_plate_preheat_start_flag) { if (get_temp_cb_s() >= heating_plate_target_temp + heating_plate_variable_temperature_range) { T_heating_plate_stop(); } else if (get_temp_cb_s() <= heating_plate_target_temp - heating_plate_variable_temperature_range) { T_heating_plate_start(); } } }