Skip to content

Commit f9df5f5

Browse files
committed
Make display work. Revert _INVERTED display type.
1 parent 05ed7b9 commit f9df5f5

File tree

3 files changed

+29
-19
lines changed

3 files changed

+29
-19
lines changed

Firmware/RTK_Everywhere/Begin.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,8 @@ void beginBoard()
800800

801801
present.display_i2c0 = true;
802802
// present.i2c0BusSpeed_400 = true; // Run display bus at higher speed
803-
present.display_type = DISPLAY_128x64_INVERTED;
803+
present.display_type = DISPLAY_128x64;
804+
present.displayInverted = true;
804805
present.tiltPossible = true;
805806

806807
pin_I2C0_SDA = 15;

Firmware/RTK_Everywhere/Display.ino

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ void beginDisplay(TwoWire *i2cBus)
146146
oled->setVcomDeselect(kOLEDMicroVCOM);
147147
}
148148

149-
if (present.display_type == DISPLAY_128x64 || present.display_type == DISPLAY_128x64_INVERTED)
149+
if (present.display_type == DISPLAY_128x64)
150150
{
151151
i2cAddress = kOLEDMicroDefaultAddress;
152152

@@ -182,7 +182,7 @@ void beginDisplay(TwoWire *i2cBus)
182182

183183
systemPrintln("Display started");
184184

185-
if (present.display_type == DISPLAY_128x64_INVERTED)
185+
if (present.displayInverted == true)
186186
{
187187
oled->flipVertical(true);
188188
oled->flipHorizontal(true);
@@ -377,7 +377,8 @@ void displayUpdate()
377377
break;
378378

379379
case (STATE_NTPSERVER_NOT_STARTED):
380-
case (STATE_NTPSERVER_NO_SYNC): {
380+
case (STATE_NTPSERVER_NO_SYNC):
381+
{
381382
paintClock(&iconPropertyList, true); // Blink
382383
displaySivVsOpenShort(&iconPropertyList);
383384

@@ -398,7 +399,8 @@ void displayUpdate()
398399
}
399400
break;
400401

401-
case (STATE_NTPSERVER_SYNC): {
402+
case (STATE_NTPSERVER_SYNC):
403+
{
402404
paintClock(&iconPropertyList, false); // No blink
403405
displaySivVsOpenShort(&iconPropertyList);
404406
paintLogging(&iconPropertyList, false, true); // No pulse, NTP
@@ -745,7 +747,7 @@ void setRadioIcons(std::vector<iconPropertyBlinking> *iconList)
745747
}
746748
}
747749
}
748-
else if (present.display_type == DISPLAY_128x64 || present.display_type == DISPLAY_128x64_INVERTED)
750+
else if (present.display_type == DISPLAY_128x64)
749751
{
750752
paintMACAddress4digit(0, 3); // Columns 0 to 22
751753

@@ -914,19 +916,22 @@ void setRadioIcons(std::vector<iconPropertyBlinking> *iconList)
914916
paintDynamicModel(iconList);
915917
break;
916918
case (STATE_BASE_TEMP_SETTLE):
917-
case (STATE_BASE_TEMP_SURVEY_STARTED): {
919+
case (STATE_BASE_TEMP_SURVEY_STARTED):
920+
{
918921
prop.duty = 0b00001111;
919922
prop.icon = BaseTemporaryProperties.iconDisplay[present.display_type];
920923
iconList->push_back(prop);
921924
}
922925
break;
923-
case (STATE_BASE_TEMP_TRANSMITTING): {
926+
case (STATE_BASE_TEMP_TRANSMITTING):
927+
{
924928
prop.duty = 0b11111111;
925929
prop.icon = BaseTemporaryProperties.iconDisplay[present.display_type];
926930
iconList->push_back(prop);
927931
}
928932
break;
929-
case (STATE_BASE_FIXED_TRANSMITTING): {
933+
case (STATE_BASE_FIXED_TRANSMITTING):
934+
{
930935
prop.duty = 0b11111111;
931936
prop.icon = BaseFixedProperties.iconDisplay[present.display_type];
932937
iconList->push_back(prop);
@@ -1264,21 +1269,24 @@ void setModeIcon(std::vector<iconPropertyBlinking> *iconList)
12641269
case (STATE_BASE_NOT_STARTED):
12651270
// Do nothing. Static display shown during state change.
12661271
break;
1267-
case (STATE_BASE_TEMP_SETTLE): {
1272+
case (STATE_BASE_TEMP_SETTLE):
1273+
{
12681274
iconPropertyBlinking prop;
12691275
prop.duty = 0b00001111;
12701276
prop.icon = BaseTemporaryProperties.iconDisplay[present.display_type];
12711277
iconList->push_back(prop);
12721278
}
12731279
break;
1274-
case (STATE_BASE_TEMP_SURVEY_STARTED): {
1280+
case (STATE_BASE_TEMP_SURVEY_STARTED):
1281+
{
12751282
iconPropertyBlinking prop;
12761283
prop.duty = 0b00001111;
12771284
prop.icon = BaseTemporaryProperties.iconDisplay[present.display_type];
12781285
iconList->push_back(prop);
12791286
}
12801287
break;
1281-
case (STATE_BASE_TEMP_TRANSMITTING): {
1288+
case (STATE_BASE_TEMP_TRANSMITTING):
1289+
{
12821290
iconPropertyBlinking prop;
12831291
prop.duty = 0b11111111;
12841292
prop.icon = BaseTemporaryProperties.iconDisplay[present.display_type];
@@ -1288,7 +1296,8 @@ void setModeIcon(std::vector<iconPropertyBlinking> *iconList)
12881296
case (STATE_BASE_FIXED_NOT_STARTED):
12891297
// Do nothing. Static display shown during state change.
12901298
break;
1291-
case (STATE_BASE_FIXED_TRANSMITTING): {
1299+
case (STATE_BASE_FIXED_TRANSMITTING):
1300+
{
12921301
iconPropertyBlinking prop;
12931302
prop.duty = 0b11111111;
12941303
prop.icon = BaseFixedProperties.iconDisplay[present.display_type];
@@ -1615,7 +1624,7 @@ void displayBaseSiv(std::vector<iconPropertyBlinking> *iconList)
16151624
{
16161625
// Display SIV during Base - but only on 128x64 displays. 64x48 has no room.
16171626
// No support for short / open.
1618-
if (present.display_type == DISPLAY_128x64 || present.display_type == DISPLAY_128x64_INVERTED)
1627+
if (present.display_type == DISPLAY_128x64)
16191628
{
16201629
displayCoords textCoords = paintSIVIcon(iconList, &BaseSIVIconProperties, 0b11111111);
16211630
paintSIVText(textCoords);
@@ -2025,7 +2034,7 @@ void displayFullIPAddress(std::vector<iconPropertyBlinking> *iconList) // Bottom
20252034
static NetPriority_t previousPriority;
20262035

20272036
// Max width: 15*6 = 90 pixels (6 pixels per character, nnn.nnn.nnn.nnn)
2028-
if (present.display_type == DISPLAY_128x64 || present.display_type == DISPLAY_128x64_INVERTED)
2037+
if (present.display_type == DISPLAY_128x64)
20292038
{
20302039
char myAddress[16];
20312040

@@ -2663,7 +2672,7 @@ void paintDisplaySetup()
26632672
constructSetupDisplay(&setupButtons); // Construct the vector (linked list) of buttons
26642673

26652674
uint8_t maxButtons =
2666-
((present.display_type == DISPLAY_128x64 || present.display_type == DISPLAY_128x64_INVERTED) ? 5 : 4);
2675+
((present.display_type == DISPLAY_128x64) ? 5 : 4);
26672676

26682677
uint8_t printedButtons = 0;
26692678

@@ -2679,7 +2688,7 @@ void paintDisplaySetup()
26792688
if (it->newState == STATE_PROFILE)
26802689
{
26812690
int nameWidth =
2682-
((present.display_type == DISPLAY_128x64 || present.display_type == DISPLAY_128x64_INVERTED)
2691+
((present.display_type == DISPLAY_128x64)
26832692
? 17
26842693
: 9);
26852694
char miniProfileName[nameWidth] = {0};
@@ -2847,7 +2856,7 @@ void paintResets()
28472856
else
28482857
oled->print(settings.resetCount + bufferOverruns);
28492858
}
2850-
else // if (present.display_type == DISPLAY_128x64 || present.display_type == DISPLAY_128x64_INVERTED)
2859+
else // if (present.display_type == DISPLAY_128x64)
28512860
{
28522861
oled->setFont(QW_FONT_5X7); // Small font
28532862
oled->setCursor(0, oled->getHeight() - 10); // x, y

Firmware/RTK_Everywhere/settings.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ typedef enum
227227
{
228228
DISPLAY_64x48,
229229
DISPLAY_128x64,
230-
DISPLAY_128x64_INVERTED,
231230
// Add new displays above this line
232231
DISPLAY_MAX_NONE // This represents the maximum numbers of display and also "no display"
233232
} DisplayType;
@@ -1814,6 +1813,7 @@ struct struct_present
18141813
bool display_i2c0 = false;
18151814
bool display_i2c1 = false;
18161815
DisplayType display_type = DISPLAY_MAX_NONE;
1816+
bool displayInverted = false;
18171817

18181818
bool fuelgauge_max17048 = false;
18191819
bool fuelgauge_bq40z50 = false;

0 commit comments

Comments
 (0)