mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-21 15:25:36 +03:00
cosmetic changes
This commit is contained in:
parent
4cd1f4efb4
commit
78049955dd
3 changed files with 43 additions and 2 deletions
|
@ -745,13 +745,21 @@ blackboxBufferReserveStatus_e blackboxDeviceReserveBufferSpace(int32_t bytes)
|
|||
return BLACKBOX_RESERVE_PERMANENT_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
int8_t blackboxGetLogFileNo(void)
|
||||
{
|
||||
#ifdef USE_BLACKBOX
|
||||
#ifdef USE_SDCARD
|
||||
// return current file number or -1
|
||||
if (blackboxSDCard.state == BLACKBOX_SDCARD_READY_TO_LOG) {
|
||||
return blackboxSDCard.largestLogFileNumber;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
#else
|
||||
// will be implemented later for flash based storage
|
||||
return -1;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
#endif // BLACKBOX
|
||||
|
|
|
@ -570,6 +570,35 @@ static void showTasksPage(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_BLACKBOX
|
||||
static void showBBPage(void)
|
||||
{
|
||||
uint8_t rowIndex = PAGE_TITLE_LINE_COUNT;
|
||||
int8_t fileNo;
|
||||
if (isBlackboxDeviceWorking()) {
|
||||
switch (blackboxConfig()->device) {
|
||||
case BLACKBOX_DEVICE_SDCARD:
|
||||
fileNo = blackboxGetLogFileNo();
|
||||
if( fileNo > 0) {
|
||||
tfp_sprintf(lineBuffer, "File no: %d", fileNo);
|
||||
} else {
|
||||
tfp_sprintf(lineBuffer, "Not ready yet");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
tfp_sprintf(lineBuffer, "Not supp. dev.");
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
tfp_sprintf(lineBuffer, "BB not working");
|
||||
}
|
||||
|
||||
padLineBuffer();
|
||||
i2c_OLED_set_line(bus, rowIndex++);
|
||||
i2c_OLED_send_string(bus, lineBuffer);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_DEBUG_DASHBOARD_PAGE
|
||||
|
||||
static void showDebugPage(void)
|
||||
|
@ -624,7 +653,9 @@ static const pageEntry_t pages[PAGE_COUNT] = {
|
|||
#if defined(USE_TASK_STATISTICS)
|
||||
{ PAGE_TASKS, "TASKS", showTasksPage, PAGE_FLAGS_NONE },
|
||||
#endif
|
||||
#ifdef USE_BLACKBOX
|
||||
{ PAGE_BB, "BLACK BOX", showBBPage, PAGE_FLAGS_NONE },
|
||||
#endif
|
||||
#ifdef ENABLE_DEBUG_DASHBOARD_PAGE
|
||||
{ PAGE_DEBUG, "DEBUG", showDebugPage, PAGE_FLAGS_NONE },
|
||||
#endif
|
||||
|
|
|
@ -53,7 +53,9 @@ typedef enum {
|
|||
#ifdef ENABLE_DEBUG_DASHBOARD_PAGE
|
||||
PAGE_DEBUG,
|
||||
#endif
|
||||
#ifdef USE_BLACKBOX
|
||||
PAGE_BB,
|
||||
#endif
|
||||
PAGE_COUNT
|
||||
} pageId_e;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue