Skip to content

Commit 84356d4

Browse files
author
dave
committed
#107 fix up problem with palette size causing issues on 32 bit boards.
1 parent 384ca34 commit 84356d4

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

examples/esp32SimHub/esp32SimHub.ino

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ void setup() {
9292
// if you want to test your rendering without simhub connected, uncomment the below code, it will update all the
9393
// values a few times a second.
9494
//
95-
taskManager.scheduleFixedRate(3000, [] {
95+
/*taskManager.scheduleFixedRate(3000, [] {
9696
menuTyreTemp.setCurrentValue(random(50) + 40);
9797
auto gear = random(10);
9898
if(gear == 0) menuGear.setTextValue("N");
@@ -105,25 +105,22 @@ void setup() {
105105
}
106106
});
107107
108-
taskManager.scheduleFixedRate(250, [] {
108+
taskManager.scheduleFixedRate(500, [] {
109109
for(int i=0;i<10;i++) {
110110
dashCustomDrawing->setLed(i, i%2==currentLedStatus);
111111
}
112112
currentLedStatus = currentLedStatus == 0 ? 1 : 0;
113113
});
114114
115-
taskManager.scheduleFixedRate(100, [] {
115+
taskManager.scheduleFixedRate(250, [] {
116116
int rpm = menuRPM.getCurrentValue();
117117
int speed = menuSpeed.getCurrentValue();
118118
119119
speed = min(250, max(5, speed + (rand() % 4) - 1));
120120
rpm = min(16000, max(1500, rpm + (rand() % 100) - 25));
121121
menuRPM.setCurrentValue(rpm);
122122
menuSpeed.setCurrentValue(speed);
123-
});
124-
// end simulation code
125123
126-
taskManager.scheduleFixedRate(250, [] {
127124
int rpm = menuRPM.getCurrentValue();
128125
uint16_t color;
129126
if(rpm < 6500) {
@@ -136,7 +133,8 @@ void setup() {
136133
for (int i = 0; i < LED_STATES; i++) {
137134
dashCustomDrawing->setLed(i, color);
138135
}
139-
});
136+
});*/
137+
// end manually adjusting values
140138
}
141139

142140
// All IoAbstraction and TcMenu sketches need the runLoop to be called very frequently, preferably in the loop

src/graphics/GfxMenuConfig.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,8 @@ namespace tcgfx {
347347
*/
348348
class NullItemDisplayPropertiesFactory : public ItemDisplayPropertiesFactory {
349349
private:
350-
ItemDisplayProperties props = ItemDisplayProperties(0, {}, MenuPadding(0), nullptr, 1, 0, 1, GridPosition::JUSTIFY_TITLE_LEFT_VALUE_RIGHT, MenuBorder());
350+
color_t anEmptyPalette[4] = {0};
351+
ItemDisplayProperties props = ItemDisplayProperties(0, anEmptyPalette, MenuPadding(0), nullptr, 1, 0, 1, GridPosition::JUSTIFY_TITLE_LEFT_VALUE_RIGHT, MenuBorder());
351352
BtreeList<uint16_t, GridPositionWithId> gridByItem;
352353
public:
353354
NullItemDisplayPropertiesFactory() : gridByItem(4) {}

0 commit comments

Comments
 (0)