Skip to content

Commit 7023d9c

Browse files
committed
Improve OLED telemetry display
1 parent 70161cb commit 7023d9c

4 files changed

Lines changed: 24 additions & 6 deletions

File tree

9.53 KB
Loading

doc/hardware/ui/MonochromeOLED/MonochromeOLED_en.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ It will show the following information thanks to SimHub:
99
- RPM bar.
1010
- Current gear.
1111
- Low fuel alert.
12+
- Pit limiter alert.
1213
- TC and ABS engagement alerts.
1314
- Current TC and ABS settings.
1415
- Current brake bias (BB).

doc/hardware/ui/TelemetryData_en.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Follow the links for an in-depth explanation:
1515
- [Monochrome OLED 128x64 telemetry display](./MonochromeOLED/MonochromeOLED_en.md)
1616

1717
A monochrome OLED with 128x64 pixels showing RPM bar,
18-
gear, TC, ABS and brake bias.
18+
gear, TC, ABS, brake bias, fuel and pit limiter alerts.
1919

2020
Any telemetry display is potentially able to display notifications
2121
(such as connection or low battery),

src/common/SimWheelUI_gfx.cpp

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ void OledTelemetry128x64::onTelemetryData(const TelemetryData *pTelemetryData)
169169

170170
if (pTelemetryData)
171171
{
172+
// Determine flashing
172173
if (_impl->flash && !pTelemetryData->powertrain.shiftLight2)
173174
{
174175
// Stop flashing
@@ -179,7 +180,13 @@ void OledTelemetry128x64::onTelemetryData(const TelemetryData *pTelemetryData)
179180
_impl->flash = pTelemetryData->powertrain.shiftLight2;
180181
uint8_t aux;
181182

183+
// Clear the frame buffer
182184
_impl->frame.fillScreen(0);
185+
186+
// Create 3 vertical sections
187+
_impl->frame.drawFastVLine(38, 8, 56, 0xFFFF);
188+
_impl->frame.drawFastVLine(89, 8, 56, 0xFFFF);
189+
183190
// Draw RPM bar
184191
aux = map(pTelemetryData->powertrain.rpmPercent, 0, 100, 0, 128);
185192
_impl->frame.drawRect(0, 0, 128, 7, 0xFFFF);
@@ -189,10 +196,10 @@ void OledTelemetry128x64::onTelemetryData(const TelemetryData *pTelemetryData)
189196
_impl->frame.setTextSize(3);
190197
aux = (pTelemetryData->powertrain.shiftLight1) ? 0 : 0xFF;
191198
if (pTelemetryData->powertrain.shiftLight1)
192-
_impl->frame.fillRect(52, 25, 21, 27, 0xFFFF);
199+
_impl->frame.fillRect(53, 17, 22, 27, 0xFFFF);
193200
_impl->frame.drawChar(
194-
55,
195-
28,
201+
56,
202+
20,
196203
pTelemetryData->powertrain.gear,
197204
aux,
198205
!aux, 3);
@@ -244,9 +251,19 @@ void OledTelemetry128x64::onTelemetryData(const TelemetryData *pTelemetryData)
244251

245252
// Draw fuel warning
246253
if (pTelemetryData->ecu.lowFuelAlert)
247-
_impl->frame.drawChar(61, 10, 'F', 0xFF, 0, 1);
254+
{
255+
// Text size: 1
256+
_impl->frame.drawChar(11, 49, 'F', 0xFF, 0, 1);
257+
}
258+
259+
// Draw pit limiter witness
260+
if (pTelemetryData->ecu.pitLimiter)
261+
{
262+
// Text size: 1
263+
_impl->frame.drawChar(116, 49, 'P', 0xFF, 0, 1);
264+
}
248265
}
249-
else
266+
else if (_impl->connected) // && !pTelemetryData
250267
{
251268
_impl->frame.fillScreen(0);
252269
stopFlashing();

0 commit comments

Comments
 (0)