void dashboardInit(void) { static busDevice_t dashBoardBus; dashBoardBus.i2c.device = I2C_CFG_TO_DEV(dashboardConfig()->device); dashBoardBus.i2c.address = dashboardConfig()->address; bus = &dashBoardBus; delay(200); resetDisplay(); delay(200); displayPort = displayPortOledInit(bus); #if defined(CMS) if (dashboardPresent) { cmsDisplayPortRegister(displayPort); } #endif memset(&pageState, 0, sizeof(pageState)); dashboardSetPage(PAGE_WELCOME); uint32_t now = micros(); dashboardUpdate(now); dashboardSetNextPageChangeAt(now + PAGE_CYCLE_FREQUENCY); }
void dashboardInit(void) { delay(200); resetDisplay(); delay(200); displayPort = displayPortOledInit(); #if defined(CMS) cmsDisplayPortRegister(displayPort); #endif dashboardSetPage(PAGE_WELCOME); const timeUs_t now = micros(); dashboardSetNextPageChangeAt(now + 5 * MICROSECONDS_IN_A_SECOND); dashboardUpdate(now); }
void osdInit(displayPort_t *osdDisplayPortToUse) { if (!osdDisplayPortToUse) { return; } BUILD_BUG_ON(OSD_POS_MAX != OSD_POS(31,31)); osdDisplayPort = osdDisplayPortToUse; #ifdef USE_CMS cmsDisplayPortRegister(osdDisplayPort); #endif armState = ARMING_FLAG(ARMED); memset(blinkBits, 0, sizeof(blinkBits)); displayClearScreen(osdDisplayPort); osdDrawLogo(3, 1); char string_buffer[30]; tfp_sprintf(string_buffer, "V%s", FC_VERSION_STRING); displayWrite(osdDisplayPort, 20, 6, string_buffer); #ifdef USE_CMS displayWrite(osdDisplayPort, 7, 8, CMS_STARTUP_HELP_TEXT1); displayWrite(osdDisplayPort, 11, 9, CMS_STARTUP_HELP_TEXT2); displayWrite(osdDisplayPort, 11, 10, CMS_STARTUP_HELP_TEXT3); #endif #ifdef USE_RTC_TIME char dateTimeBuffer[FORMATTED_DATE_TIME_BUFSIZE]; if (osdFormatRtcDateTime(&dateTimeBuffer[0])) { displayWrite(osdDisplayPort, 5, 12, dateTimeBuffer); } #endif displayResync(osdDisplayPort); resumeRefreshAt = micros() + (4 * REFRESH_1S); }