cooling/cooling.cc
/// Stop the fan (if we have control of it) and it has been running at
/// least m_min_cool_secs.
///
Stop the fan (if we have control of it) and it has been running at
least m_min_cool_secs.
Stop the fan ( if we have control of it ) and it has been running at least m_min_cool_secs .
void Cooling::stop_fan()
{
    if (not m_fan_control_enabled) return;
    if (!m_fan_running) return;
    if (m_fan_gpio) {
        time_t tnow = time(0);
        if ((tnow - m_last_cool_start) < m_min_cool_secs) return;
        try {
            m_fan_gpio.set_value(GPIO_OFF);
            LOG_INFO(Lgr) << "Halted FAN at temp=" << m_degc;
            m_fan_running = false;
        } catch ( std::exception &ex ) {
            LOG_ERROR(Lgr) << "Fan Stop operation failed: " << ex.what();
            m_gpio_errors++;
        }
    }
}
void Cooling :: stop_fan ( ) { if ( not m_fan_control_enabled ) return ; if ( ! m_fan_running ) return ; if ( m_fan_gpio ) { time_t tnow = time ( 0 ) ; if ( ( tnow - m_last_cool_start ) < m_min_cool_secs ) return ; try { m_fan_gpio . set_value ( GPIO_OFF ) ; LOG_INFO ( Lgr ) << " " << m_degc ; m_fan_running = false ; } catch ( std :: exception & ex ) { LOG_ERROR ( Lgr ) << " " << ex . what ( ) ; m_gpio_errors ++ ; } } }
Stop the fan (if we have control of it) and it has been running at
least m_min_cool_secs.
Stop the fan ( if we have control of it ) and it has been running at least m_min_cool_secs .