mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-18 05:45:31 +03:00
Merge pull request #3342 from DanNixon/osd_bb_log_no
Add post flight statistic for SD card blackbox log number
This commit is contained in:
commit
facac4c3e6
5 changed files with 28 additions and 11 deletions
|
@ -511,6 +511,14 @@ bool isBlackboxDeviceFull(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned int blackboxGetLogNumber()
|
||||||
|
{
|
||||||
|
#ifdef USE_SDCARD
|
||||||
|
return blackboxSDCard.largestLogFileNumber;
|
||||||
|
#endif
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Call once every loop iteration in order to maintain the global blackboxHeaderBudget with the number of bytes we can
|
* Call once every loop iteration in order to maintain the global blackboxHeaderBudget with the number of bytes we can
|
||||||
* transmit this iteration.
|
* transmit this iteration.
|
||||||
|
|
|
@ -52,6 +52,7 @@ bool blackboxDeviceBeginLog(void);
|
||||||
bool blackboxDeviceEndLog(bool retainLog);
|
bool blackboxDeviceEndLog(bool retainLog);
|
||||||
|
|
||||||
bool isBlackboxDeviceFull(void);
|
bool isBlackboxDeviceFull(void);
|
||||||
|
unsigned int blackboxGetLogNumber();
|
||||||
|
|
||||||
void blackboxReplenishHeaderBudget();
|
void blackboxReplenishHeaderBudget();
|
||||||
blackboxBufferReserveStatus_e blackboxDeviceReserveBufferSpace(int32_t bytes);
|
blackboxBufferReserveStatus_e blackboxDeviceReserveBufferSpace(int32_t bytes);
|
||||||
|
|
|
@ -678,6 +678,7 @@ const clivalue_t valueTable[] = {
|
||||||
{ "osd_stat_endbatt", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_OSD_CONFIG, offsetof(osdConfig_t, enabled_stats[OSD_STAT_END_BATTERY])},
|
{ "osd_stat_endbatt", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_OSD_CONFIG, offsetof(osdConfig_t, enabled_stats[OSD_STAT_END_BATTERY])},
|
||||||
{ "osd_stat_flytime", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_OSD_CONFIG, offsetof(osdConfig_t, enabled_stats[OSD_STAT_FLYTIME])},
|
{ "osd_stat_flytime", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_OSD_CONFIG, offsetof(osdConfig_t, enabled_stats[OSD_STAT_FLYTIME])},
|
||||||
{ "osd_stat_armtime", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_OSD_CONFIG, offsetof(osdConfig_t, enabled_stats[OSD_STAT_ARMEDTIME])},
|
{ "osd_stat_armtime", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_OSD_CONFIG, offsetof(osdConfig_t, enabled_stats[OSD_STAT_ARMEDTIME])},
|
||||||
|
{ "osd_stat_bb_no", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_OSD_CONFIG, offsetof(osdConfig_t, enabled_stats[OSD_STAT_BLACKBOX_NUMBER])},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// PG_SYSTEM_CONFIG
|
// PG_SYSTEM_CONFIG
|
||||||
|
|
|
@ -748,6 +748,7 @@ void pgResetFn_osdConfig(osdConfig_t *osdConfig)
|
||||||
osdConfig->enabled_stats[OSD_STAT_FLYTIME] = false;
|
osdConfig->enabled_stats[OSD_STAT_FLYTIME] = false;
|
||||||
osdConfig->enabled_stats[OSD_STAT_ARMEDTIME] = true;
|
osdConfig->enabled_stats[OSD_STAT_ARMEDTIME] = true;
|
||||||
osdConfig->enabled_stats[OSD_STAT_MAX_DISTANCE] = false;
|
osdConfig->enabled_stats[OSD_STAT_MAX_DISTANCE] = false;
|
||||||
|
osdConfig->enabled_stats[OSD_STAT_BLACKBOX_NUMBER] = true;
|
||||||
|
|
||||||
osdConfig->units = OSD_UNIT_METRIC;
|
osdConfig->units = OSD_UNIT_METRIC;
|
||||||
|
|
||||||
|
@ -1021,6 +1022,11 @@ static void osdShowStats(void)
|
||||||
osdGetBlackboxStatusString(buff);
|
osdGetBlackboxStatusString(buff);
|
||||||
osdDisplayStatisticLabel(top++, "BLACKBOX", buff);
|
osdDisplayStatisticLabel(top++, "BLACKBOX", buff);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (osdConfig()->enabled_stats[OSD_STAT_BLACKBOX_NUMBER] && blackboxConfig()->device && blackboxConfig()->device != BLACKBOX_DEVICE_SERIAL) {
|
||||||
|
itoa(blackboxGetLogNumber(), buff, 10);
|
||||||
|
osdDisplayStatisticLabel(top++, "BB LOG NUM", buff);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Reset time since last armed here to ensure this timer is at zero when back at "main" OSD screen */
|
/* Reset time since last armed here to ensure this timer is at zero when back at "main" OSD screen */
|
||||||
|
|
|
@ -80,6 +80,7 @@ typedef enum {
|
||||||
OSD_STAT_FLYTIME,
|
OSD_STAT_FLYTIME,
|
||||||
OSD_STAT_ARMEDTIME,
|
OSD_STAT_ARMEDTIME,
|
||||||
OSD_STAT_MAX_DISTANCE,
|
OSD_STAT_MAX_DISTANCE,
|
||||||
|
OSD_STAT_BLACKBOX_NUMBER,
|
||||||
OSD_STAT_COUNT // MUST BE LAST
|
OSD_STAT_COUNT // MUST BE LAST
|
||||||
} osd_stats_e;
|
} osd_stats_e;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue