void pgResetFn_osdConfig(osdConfig_t *osdConfig) { // Position elements near centre of screen and disabled by default for (int i = 0; i < OSD_ITEM_COUNT; i++) { osdConfig->item_pos[i] = OSD_POS(10, 7); } // Always enable warnings elements by default osdConfig->item_pos[OSD_WARNINGS] = OSD_POS(9, 10) | VISIBLE_FLAG; // Default to old fixed positions for these elements osdConfig->item_pos[OSD_CROSSHAIRS] = OSD_POS(13, 6); osdConfig->item_pos[OSD_ARTIFICIAL_HORIZON] = OSD_POS(14, 2); osdConfig->item_pos[OSD_HORIZON_SIDEBARS] = OSD_POS(14, 6); // Enable the default stats osdConfig->enabled_stats = 0; // reset all to off and enable only a few initially osdStatSetState(OSD_STAT_MAX_SPEED, true); osdStatSetState(OSD_STAT_MIN_BATTERY, true); osdStatSetState(OSD_STAT_MIN_RSSI, true); osdStatSetState(OSD_STAT_MAX_CURRENT, true); osdStatSetState(OSD_STAT_USED_MAH, true); osdStatSetState(OSD_STAT_BLACKBOX, true); osdStatSetState(OSD_STAT_BLACKBOX_NUMBER, true); osdStatSetState(OSD_STAT_TIMER_2, true); osdConfig->units = OSD_UNIT_METRIC; // Enable all warnings by default for (int i=0; i < OSD_WARNING_COUNT; i++) { osdWarnSetState(i, true); } osdConfig->timers[OSD_TIMER_1] = OSD_TIMER(OSD_TIMER_SRC_ON, OSD_TIMER_PREC_SECOND, 10); osdConfig->timers[OSD_TIMER_2] = OSD_TIMER(OSD_TIMER_SRC_TOTAL_ARMED, OSD_TIMER_PREC_SECOND, 10); osdConfig->rssi_alarm = 20; osdConfig->cap_alarm = 2200; osdConfig->alt_alarm = 100; // meters or feet depend on configuration osdConfig->esc_temp_alarm = ESC_TEMP_ALARM_OFF; // off by default osdConfig->esc_rpm_alarm = ESC_RPM_ALARM_OFF; // off by default osdConfig->esc_current_alarm = ESC_CURRENT_ALARM_OFF; // off by default osdConfig->core_temp_alarm = 70; // a temperature above 70C should produce a warning, lockups have been reported above 80C osdConfig->ahMaxPitch = 20; // 20 degrees osdConfig->ahMaxRoll = 40; // 40 degrees }
static long menuTimersOnExit(const OSD_Entry *self) { UNUSED(self); for (int i = 0; i < OSD_TIMER_COUNT; i++) { osdConfigMutable()->timers[i] = OSD_TIMER(timerSource[i], timerPrecision[i], timerAlarm[i]); } return 0; }