mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-02 02:39:57 +00:00
Merge branch 'master' into potential-sx1262-fix
This commit is contained in:
commit
daac79f314
@ -283,27 +283,27 @@ static void drawModuleFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int
|
|||||||
|
|
||||||
static void drawFrameBluetooth(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
|
static void drawFrameBluetooth(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
|
||||||
{
|
{
|
||||||
|
int x_offset = display->width() / 2;
|
||||||
|
int y_offset = display->height() == 64 ? 0 : 32;
|
||||||
display->setTextAlignment(TEXT_ALIGN_CENTER);
|
display->setTextAlignment(TEXT_ALIGN_CENTER);
|
||||||
display->setFont(FONT_MEDIUM);
|
display->setFont(FONT_MEDIUM);
|
||||||
display->drawString(64 + x, y, "Bluetooth");
|
display->drawString(x_offset + x, y_offset + y, "Bluetooth");
|
||||||
|
|
||||||
display->setFont(FONT_SMALL);
|
display->setFont(FONT_SMALL);
|
||||||
display->drawString(64 + x, FONT_HEIGHT_SMALL + y + 2, "Enter this code");
|
y_offset = display->height() == 64 ? y_offset + FONT_HEIGHT_MEDIUM -4 : y_offset + FONT_HEIGHT_MEDIUM + 5;
|
||||||
|
display->drawString(x_offset + x, y_offset + y, "Enter this code");
|
||||||
|
|
||||||
display->setFont(FONT_LARGE);
|
display->setFont(FONT_LARGE);
|
||||||
|
String displayPin(btPIN);
|
||||||
|
String pin = displayPin.substring(0, 3) + " " + displayPin.substring(3, 6);
|
||||||
|
y_offset = display->height() == 64 ? y_offset + FONT_HEIGHT_SMALL - 5 : y_offset + FONT_HEIGHT_SMALL + 5;
|
||||||
|
display->drawString(x_offset + x, y_offset + y, pin);
|
||||||
|
|
||||||
auto displayPin = new String(btPIN);
|
|
||||||
display->setTextAlignment(TEXT_ALIGN_LEFT);
|
|
||||||
display->drawString(12 + x, 26 + y, displayPin->substring(0, 3));
|
|
||||||
display->drawString(72 + x, 26 + y, displayPin->substring(3, 6));
|
|
||||||
|
|
||||||
display->setTextAlignment(TEXT_ALIGN_CENTER);
|
|
||||||
display->setFont(FONT_SMALL);
|
display->setFont(FONT_SMALL);
|
||||||
char buf[30];
|
String deviceName = "Name: ";
|
||||||
const char *name = "Name: ";
|
deviceName.concat(getDeviceName());
|
||||||
strcpy(buf, name);
|
y_offset = display->height() == 64 ? y_offset + FONT_HEIGHT_LARGE - 6 : y_offset + FONT_HEIGHT_LARGE + 5;
|
||||||
strcat(buf, getDeviceName());
|
display->drawString(x_offset + x, y_offset + y, deviceName);
|
||||||
display->drawString(64 + x, 48 + y, buf);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void drawFrameShutdown(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
|
static void drawFrameShutdown(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
|
||||||
|
Loading…
Reference in New Issue
Block a user