|
|
@ -11,9 +11,16 @@ |
|
|
|
|
|
|
|
#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(void) {} |
|
|
|
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; } |
|
|
|
|
|
|
@ -21,4 +28,17 @@ void T_heating_plate_start(void) {} |
|
|
|
|
|
|
|
void T_heating_plate_stop(void) {} |
|
|
|
|
|
|
|
void T_heating_plate_schedule(void) { get_temp_cb_s(); } |
|
|
|
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(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |