mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 06:15:16 +03:00
Add a debug page to the OLED display.
This commit is contained in:
parent
893023d21b
commit
a6a72be0d2
1 changed files with 21 additions and 1 deletions
|
@ -67,6 +67,7 @@ typedef enum {
|
|||
PAGE_SENSORS,
|
||||
PAGE_RX,
|
||||
PAGE_PROFILE,
|
||||
PAGE_DEBUG
|
||||
} pageId_e;
|
||||
|
||||
const char* pageTitles[] = {
|
||||
|
@ -75,13 +76,15 @@ const char* pageTitles[] = {
|
|||
"BATTERY",
|
||||
"SENSORS",
|
||||
"RX",
|
||||
"PROFILE"
|
||||
"PROFILE",
|
||||
"DEBUG"
|
||||
};
|
||||
|
||||
#define PAGE_COUNT (PAGE_RX + 1)
|
||||
|
||||
const uint8_t cyclePageIds[] = {
|
||||
PAGE_PROFILE,
|
||||
PAGE_DEBUG,
|
||||
PAGE_BATTERY,
|
||||
PAGE_SENSORS,
|
||||
PAGE_RX
|
||||
|
@ -267,6 +270,20 @@ void showSensorsPage(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
#define PAGE_TITLE_LINE_COUNT 1
|
||||
|
||||
void showDebugPage(void)
|
||||
{
|
||||
uint8_t rowIndex;
|
||||
|
||||
for (rowIndex = 0; rowIndex < 4; rowIndex++) {
|
||||
tfp_sprintf(lineBuffer, "%d = %5d", rowIndex, debug[rowIndex]);
|
||||
padLineBuffer();
|
||||
i2c_OLED_set_line(rowIndex + PAGE_TITLE_LINE_COUNT);
|
||||
i2c_OLED_send_string(lineBuffer);
|
||||
}
|
||||
}
|
||||
|
||||
void updateDisplay(void)
|
||||
{
|
||||
uint32_t now = micros();
|
||||
|
@ -329,6 +346,9 @@ void updateDisplay(void)
|
|||
case PAGE_PROFILE:
|
||||
showProfilePage();
|
||||
break;
|
||||
case PAGE_DEBUG:
|
||||
showDebugPage();
|
||||
break;
|
||||
}
|
||||
if (!armedState) {
|
||||
updateTicker();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue