1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-24 00:35:39 +03:00

displayPort device registration changed

This commit is contained in:
jflyper 2016-11-06 02:37:45 +09:00
parent 131147322d
commit 4ae6f8c1c4
17 changed files with 224 additions and 216 deletions

View file

@ -27,21 +27,21 @@
#include "drivers/display.h"
#include "drivers/display_ug2864hsweg01.h"
#include "io/cms.h"
#include "io/displayport_oled.h"
extern bool dashboardInCMS; // temporary
// Exported
displayPort_t oledDisplayPort;
static int oledOpen(displayPort_t *displayPort)
{
dashboardInCMS = true;
displayPort->inCMS = true;
UNUSED(displayPort);
return 0;
}
static int oledClose(displayPort_t *displayPort)
{
dashboardInCMS = false;
displayPort->inCMS = false;
UNUSED(displayPort);
return 0;
}
@ -87,10 +87,13 @@ static const displayPortVTable_t oledVTable = {
.txBytesFree = oledTxBytesFree
};
void displayPortOledInit(displayPort_t *displayPort)
void displayPortOledInit()
{
displayPort->vTable = &oledVTable;
displayPort->rows = SCREEN_CHARACTER_ROW_COUNT;
displayPort->cols = SCREEN_CHARACTER_COLUMN_COUNT;
oledDisplayPort.vTable = &oledVTable;
oledDisplayPort.rows = SCREEN_CHARACTER_ROW_COUNT;
oledDisplayPort.cols = SCREEN_CHARACTER_COLUMN_COUNT;
oledDisplayPort.inCMS = false;
cmsDisplayPortRegister(&oledDisplayPort);
}
#endif // OLEDCMS