1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 14:25:20 +03:00

Make MSP displayPort respect the NTSC/PAL setting

Previously the display rows was hardcoded to 13 (NTSC). Now it will use 16 if the user has explicitly selected PAL. This allows the display to fully use the screen - particularly when in the CMS menus. Since there is no device to "AUTO" detect, this will still default to safer value of 13 rows as NTSC.

Eventually we may want to extend MSP displayPort to add an auto-detect capability. But since the protocol is a one-way "push" from the firmware to the device that's somewhat difficult. Will probably need a MSP message that the displayPort device can use to "register" its capabilities.
This commit is contained in:
Bruce Luckcuck 2021-01-16 14:22:47 -05:00
parent 35de1c8229
commit 835aadfdde
2 changed files with 6 additions and 2 deletions

View file

@ -32,6 +32,7 @@
#include "common/utils.h"
#include "drivers/display.h"
#include "drivers/osd.h"
#include "io/displayport_msp.h"
@ -39,6 +40,8 @@
#include "msp/msp_protocol.h"
#include "msp/msp_serial.h"
#include "pg/vcd.h"
static displayPort_t mspDisplayPort;
static int output(displayPort_t *displayPort, uint8_t cmd, uint8_t *buf, int len)
@ -141,7 +144,8 @@ static bool isSynced(const displayPort_t *displayPort)
static void redraw(displayPort_t *displayPort)
{
displayPort->rows = 13 + displayPortProfileMsp()->rowAdjust; // XXX Will reflect NTSC/PAL in the future
const uint8_t displayRows = (vcdProfile()->video_system == VIDEO_SYSTEM_PAL) ? 16 : 13;
displayPort->rows = displayRows + displayPortProfileMsp()->rowAdjust;
displayPort->cols = 30 + displayPortProfileMsp()->colAdjust;
drawScreen(displayPort);
}