ENH:add some protection for fan control
Change-Id: Ic60deaec60b5238f9307b7b4bb928293701c2fd5
This commit is contained in:
parent
03819e6f86
commit
c6e49af3fe
|
@ -394,7 +394,7 @@ void FanControl::command_control_fan()
|
||||||
{
|
{
|
||||||
if (m_current_speed < 0 || m_current_speed > 10) { return; }
|
if (m_current_speed < 0 || m_current_speed > 10) { return; }
|
||||||
int speed = floor(m_current_speed * float(25.5));
|
int speed = floor(m_current_speed * float(25.5));
|
||||||
if (m_update_already) {
|
if (m_update_already && m_obj) {
|
||||||
m_obj->command_control_fan_val(m_type, speed);
|
m_obj->command_control_fan_val(m_type, speed);
|
||||||
post_event(wxCommandEvent(EVT_FAN_CHANGED));
|
post_event(wxCommandEvent(EVT_FAN_CHANGED));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue