Browse Source
Merge pull request #2424 from liamcottle/ui/website
Add MeshCore website to splash screen
pull/2435/head
ripplebiz
1 month ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with
41 additions and
9 deletions
-
examples/companion_radio/ui-new/UITask.cpp
-
examples/simple_repeater/UITask.cpp
-
examples/simple_room_server/UITask.cpp
-
examples/simple_sensor/UITask.cpp
|
|
|
@ -57,13 +57,21 @@ public: |
|
|
|
int logoWidth = 128; |
|
|
|
display.drawXbm((display.width() - logoWidth) / 2, 3, meshcore_logo, logoWidth, 13); |
|
|
|
|
|
|
|
// meshcore website
|
|
|
|
const char* website = "https://meshcore.io"; |
|
|
|
display.setColor(DisplayDriver::LIGHT); |
|
|
|
display.setTextSize(1); |
|
|
|
uint16_t websiteWidth = display.getTextWidth(website); |
|
|
|
display.setCursor((display.width() - websiteWidth) / 2, 22); |
|
|
|
display.print(website); |
|
|
|
|
|
|
|
// version info
|
|
|
|
display.setColor(DisplayDriver::LIGHT); |
|
|
|
display.setTextSize(2); |
|
|
|
display.drawTextCentered(display.width()/2, 22, _version_info); |
|
|
|
display.setTextSize(1); |
|
|
|
display.drawTextCentered(display.width()/2, 35, _version_info); |
|
|
|
|
|
|
|
display.setTextSize(1); |
|
|
|
display.drawTextCentered(display.width()/2, 42, FIRMWARE_BUILD_DATE); |
|
|
|
display.drawTextCentered(display.width()/2, 48, FIRMWARE_BUILD_DATE); |
|
|
|
|
|
|
|
return 1000; |
|
|
|
} |
|
|
|
|
|
|
|
@ -52,17 +52,25 @@ void UITask::renderCurrScreen() { |
|
|
|
int logoWidth = 128; |
|
|
|
_display->drawXbm((_display->width() - logoWidth) / 2, 3, meshcore_logo, logoWidth, 13); |
|
|
|
|
|
|
|
// meshcore website
|
|
|
|
const char* website = "https://meshcore.io"; |
|
|
|
_display->setColor(DisplayDriver::LIGHT); |
|
|
|
_display->setTextSize(1); |
|
|
|
uint16_t websiteWidth = _display->getTextWidth(website); |
|
|
|
_display->setCursor((_display->width() - websiteWidth) / 2, 22); |
|
|
|
_display->print(website); |
|
|
|
|
|
|
|
// version info
|
|
|
|
_display->setColor(DisplayDriver::LIGHT); |
|
|
|
_display->setTextSize(1); |
|
|
|
uint16_t versionWidth = _display->getTextWidth(_version_info); |
|
|
|
_display->setCursor((_display->width() - versionWidth) / 2, 22); |
|
|
|
_display->setCursor((_display->width() - versionWidth) / 2, 35); |
|
|
|
_display->print(_version_info); |
|
|
|
|
|
|
|
// node type
|
|
|
|
const char* node_type = "< Repeater >"; |
|
|
|
uint16_t typeWidth = _display->getTextWidth(node_type); |
|
|
|
_display->setCursor((_display->width() - typeWidth) / 2, 35); |
|
|
|
_display->setCursor((_display->width() - typeWidth) / 2, 48); |
|
|
|
_display->print(node_type); |
|
|
|
} else { // home screen
|
|
|
|
// node name
|
|
|
|
|
|
|
|
@ -52,17 +52,25 @@ void UITask::renderCurrScreen() { |
|
|
|
int logoWidth = 128; |
|
|
|
_display->drawXbm((_display->width() - logoWidth) / 2, 3, meshcore_logo, logoWidth, 13); |
|
|
|
|
|
|
|
// meshcore website
|
|
|
|
const char* website = "https://meshcore.io"; |
|
|
|
_display->setColor(DisplayDriver::LIGHT); |
|
|
|
_display->setTextSize(1); |
|
|
|
uint16_t websiteWidth = _display->getTextWidth(website); |
|
|
|
_display->setCursor((_display->width() - websiteWidth) / 2, 22); |
|
|
|
_display->print(website); |
|
|
|
|
|
|
|
// version info
|
|
|
|
_display->setColor(DisplayDriver::LIGHT); |
|
|
|
_display->setTextSize(1); |
|
|
|
uint16_t versionWidth = _display->getTextWidth(_version_info); |
|
|
|
_display->setCursor((_display->width() - versionWidth) / 2, 22); |
|
|
|
_display->setCursor((_display->width() - versionWidth) / 2, 35); |
|
|
|
_display->print(_version_info); |
|
|
|
|
|
|
|
// node type
|
|
|
|
const char* node_type = "< Room Server >"; |
|
|
|
uint16_t typeWidth = _display->getTextWidth(node_type); |
|
|
|
_display->setCursor((_display->width() - typeWidth) / 2, 35); |
|
|
|
_display->setCursor((_display->width() - typeWidth) / 2, 48); |
|
|
|
_display->print(node_type); |
|
|
|
} else { // home screen
|
|
|
|
// node name
|
|
|
|
|
|
|
|
@ -52,17 +52,25 @@ void UITask::renderCurrScreen() { |
|
|
|
int logoWidth = 128; |
|
|
|
_display->drawXbm((_display->width() - logoWidth) / 2, 3, meshcore_logo, logoWidth, 13); |
|
|
|
|
|
|
|
// meshcore website
|
|
|
|
const char* website = "https://meshcore.io"; |
|
|
|
_display->setColor(DisplayDriver::LIGHT); |
|
|
|
_display->setTextSize(1); |
|
|
|
uint16_t websiteWidth = _display->getTextWidth(website); |
|
|
|
_display->setCursor((_display->width() - websiteWidth) / 2, 22); |
|
|
|
_display->print(website); |
|
|
|
|
|
|
|
// version info
|
|
|
|
_display->setColor(DisplayDriver::LIGHT); |
|
|
|
_display->setTextSize(1); |
|
|
|
uint16_t versionWidth = _display->getTextWidth(_version_info); |
|
|
|
_display->setCursor((_display->width() - versionWidth) / 2, 22); |
|
|
|
_display->setCursor((_display->width() - versionWidth) / 2, 35); |
|
|
|
_display->print(_version_info); |
|
|
|
|
|
|
|
// node type
|
|
|
|
const char* node_type = "< Sensor >"; |
|
|
|
uint16_t typeWidth = _display->getTextWidth(node_type); |
|
|
|
_display->setCursor((_display->width() - typeWidth) / 2, 35); |
|
|
|
_display->setCursor((_display->width() - typeWidth) / 2, 48); |
|
|
|
_display->print(node_type); |
|
|
|
} else { // home screen
|
|
|
|
// node name
|
|
|
|
|