Пример #1
0
void Display::update()
{
    // max update frequency 2Hz
    static uint8_t timer = 0;
    if (timer++ < 25) {
        return;
    }
    timer = 0;

    if (AP_Notify::flags.armed) {
        if (_screenpage != 1) {
            _driver->clear_screen();
            update_arm(3);
            _screenpage = 1;
            _driver->hw_update(); //update hw once , do not transmition to display in fly
        }
        return;
    }

    if (_screenpage != 2) {
        _driver->clear_screen(); //once clear screen when page changed
        _screenpage = 2;
    }

    update_all();
    _driver->hw_update(); //update at 2 Hz in disarmed mode

}
Пример #2
0
void Display::update_all()
{
    update_arm();
    update_prearm();
    update_gps();
    update_gps_sats();
    update_ekf();
}
Пример #3
0
void Display::update()
{
    static uint8_t timer = 0;

    // return immediately if not enabled
    if (!_healthy) {
        return;
    }

    // max update frequency 2Hz
    if (timer++ < 25) {
        return;
    }

    timer = 0;

    // check if status has changed
    if (_flags.armed != AP_Notify::flags.armed) {
        update_arm();
        _flags.armed = AP_Notify::flags.armed;
    }

    if (_flags.pre_arm_check != AP_Notify::flags.pre_arm_check) {
        update_prearm();
        _flags.pre_arm_check = AP_Notify::flags.pre_arm_check;
    }

    if (_flags.gps_status != AP_Notify::flags.gps_status) {
        update_gps();
        _flags.gps_status = AP_Notify::flags.gps_status;
    }

    if (_flags.gps_num_sats != AP_Notify::flags.gps_num_sats) {
        update_gps_sats();
        _flags.gps_num_sats = AP_Notify::flags.gps_num_sats;
    }

    if (_flags.ekf_bad != AP_Notify::flags.ekf_bad) {
        update_ekf();
        _flags.ekf_bad = AP_Notify::flags.ekf_bad;
    }

    // if somethings has changed, update display
    if (_need_update) {
        hw_update();
        _need_update = false;
    }
}