5 #ifdef HAS_THERMAL_LM75A
10 uint8_t thermal_threshold_data
[] = {
11 THERMAL_FAN_DEFAULT_HIGH_THRESHOLD
,
12 THERMAL_FAN_DEFAULT_LOW_THRESHOLD
,
13 THERMAL_FAN_ALWAYS_ON_HIGH_THRESHOLD
,
14 THERMAL_FAN_ALWAYS_ON_LOW_THRESHOLD
,
15 THERMAL_FAN_OFF_HIGH_THRESHOLD
,
16 THERMAL_FAN_OFF_LOW_THRESHOLD
19 int thermal_status
= THERMAL_STATUS_FAIL
;
24 #ifdef HAS_THERMAL_LM75A
25 status
= lm75a
.init();
29 ERRLN("Thermal failed!");
35 thermal_status
= THERMAL_STATUS_NORMAL
;
40 void Thermal::handle()
42 temp_value
= read_temp();
45 uint8_t Thermal::read_temp()
47 if(thermal_status
!= THERMAL_STATUS_NORMAL
)
49 ERRLN("thermal not ready!");
52 #ifdef HAS_THERMAL_LM75A
53 return lm75a
.read_lm75a();
59 void Thermal::update_threshold(int index
)
61 if(thermal_status
!= THERMAL_STATUS_NORMAL
)
63 ERRLN("thermal not ready!");
66 int size
= sizeof(thermal_threshold_data
)/sizeof(thermal_threshold_data
[0]);
69 ERRLN("thermal index out of range!");
72 uint8_t high
= thermal_threshold_data
[2*index
];
73 uint8_t low
= thermal_threshold_data
[2*index
+1];
74 #ifdef HAS_THERMAL_LM75A
75 lm75a
.update_lm75a_threshold(high
, low
);