Skip to content

Commit

Permalink
Fix bugs introduce in previous merged PRs (#554)
Browse files Browse the repository at this point in the history
* Fix uninitialized variable in new OLED menu

* Remove unused label warning
  • Loading branch information
nyanpasu64 authored Jun 2, 2024
1 parent 5293343 commit e4e317a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions OLEDMenuImplementation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ bool presetsCreationMenuHandler(OLEDMenuManager *manager, OLEDMenuItem *item, OL
if (slotsBinaryFileRead) {
slotsBinaryFileRead.read((byte *)&slotsObject, sizeof(slotsObject));
slotsBinaryFileRead.close();
for (int i; i < SLOTS_TOTAL; ++i) {
for (int i = 0; i < SLOTS_TOTAL; ++i) {
const SlotMeta &slot = slotsObject.slot[i];
if (strcmp(EMPTY_SLOT_NAME, slot.name) == 0 || !strlen(slot.name)) {
continue;
Expand All @@ -160,7 +160,7 @@ bool presetsCreationMenuHandler(OLEDMenuManager *manager, OLEDMenuItem *item, OL
if (curNumSlot > OLED_MENU_MAX_SUBITEMS_NUM) {
manager->registerItem(item, 0, IMAGE_ITEM(TEXT_TOO_MANY_PRESETS));
}

if (!item->numSubItem) {
manager->registerItem(item, 0, IMAGE_ITEM(TEXT_NO_PRESETS));
}
Expand Down
17 changes: 8 additions & 9 deletions gbs-control.ino
Original file line number Diff line number Diff line change
Expand Up @@ -7198,7 +7198,7 @@ void setup()
pinMode(pin_data, INPUT_PULLUP);
pinMode(pin_switch, INPUT_PULLUP);

#if USE_NEW_OLED_MENU
#if USE_NEW_OLED_MENU
attachInterrupt(digitalPinToInterrupt(pin_clk), isrRotaryEncoderRotateForNewMenu, FALLING);
attachInterrupt(digitalPinToInterrupt(pin_switch), isrRotaryEncoderPushForNewMenu, FALLING);
initOLEDMenu();
Expand Down Expand Up @@ -9415,7 +9415,7 @@ void handleType2Command(char argument)
break;
case 'O':
// info
if (GBS::ADC_INPUT_SEL::read() == 1)
if (GBS::ADC_INPUT_SEL::read() == 1)
{
SerialM.println("RGB reg");
SerialM.println(F("------------ "));
Expand All @@ -9431,8 +9431,8 @@ void handleType2Command(char argument)
SerialM.println(GBS::VDS_USIN_GAIN::read(), DEC);
SerialM.print(F("UCOS_GAIN: "));
SerialM.println(GBS::VDS_UCOS_GAIN::read(), DEC);
}
else
}
else
{
SerialM.println("YPbPr reg");
SerialM.println(F("------------ "));
Expand Down Expand Up @@ -9465,7 +9465,7 @@ void handleType2Command(char argument)
GBS::ADC_BOFCTRL::write(adco->b_off);
SerialM.println("RGB:defauit");
}
else
else
{
GBS::VDS_Y_GAIN::write(128);
GBS::VDS_UCOS_GAIN::write(28);
Expand Down Expand Up @@ -9739,7 +9739,7 @@ void startWebserver()
SPIFFS.remove("/preset_medium_res." + String((char)slot));
SPIFFS.remove("/preset_vga_upscale." + String((char)slot));
SPIFFS.remove("/preset_unknown." + String((char)slot));

uint8_t loopCount = 0;
uint8_t flag = 1;
while (flag != 0)
Expand Down Expand Up @@ -9776,8 +9776,7 @@ void startWebserver()
result = true;
}
}

fail:

request->send(200, "application/json", result ? "true" : "false");
});

Expand Down Expand Up @@ -10810,4 +10809,4 @@ void subpointerfunction()
oled_pointer_count = 7;
}
}
#endif
#endif

0 comments on commit e4e317a

Please sign in to comment.