Skip to content

Commit

Permalink
Remove unnecessary cast
Browse files Browse the repository at this point in the history
  • Loading branch information
Dewb committed Oct 8, 2024
1 parent 319f0c4 commit 7870c28
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/common/core/LibAVR32ModuleWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,6 @@ struct FirmwareSubmenuItem : MenuItem

Menu* createChildMenu() override
{
LibAVR32Module* m = dynamic_cast<LibAVR32Module*>(module);
assert(m);

Menu* menu = new Menu;

char versionbuf[512];
Expand All @@ -122,11 +119,11 @@ struct FirmwareSubmenuItem : MenuItem

menu->addChild(construct<ioRateItem>(
&MenuItem::text, "Input rate", &MenuItem::rightText, RIGHT_ARROW,
&ioRateItem::defaultValue, 2, &ioRateItem::target, &m->inputRate));
&ioRateItem::defaultValue, 2, &ioRateItem::target, &module->inputRate));

menu->addChild(construct<ioRateItem>(
&MenuItem::text, "Output rate", &MenuItem::rightText, RIGHT_ARROW,
&ioRateItem::defaultValue, 4, &ioRateItem::target, &m->outputRate));
&ioRateItem::defaultValue, 4, &ioRateItem::target, &module->outputRate));

menu->addChild(new MenuSeparator());

Expand All @@ -137,26 +134,25 @@ struct FirmwareSubmenuItem : MenuItem

menu->addChild(construct<SwitchFirmwareItem>(
&MenuItem::text, "Switch Firmware", &MenuItem::rightText, RIGHT_ARROW,
&SwitchFirmwareItem::module, m
));
&SwitchFirmwareItem::module, module));

auto hotReloadItem = new ReloadFirmwareItem();
hotReloadItem->text = "Hot Reload";
hotReloadItem->module = m;
hotReloadItem->module = module;
hotReloadItem->preserveVRAM = true;
hotReloadItem->preserveNVRAM = true;
menu->addChild(hotReloadItem);

auto reloadItem = new ReloadFirmwareItem();
reloadItem->text = "Reload & Restart";
reloadItem->module = m;
reloadItem->module = module;
reloadItem->preserveVRAM = false;
reloadItem->preserveNVRAM = true;
menu->addChild(reloadItem);

auto clearItem = new ReloadFirmwareItem();
clearItem->text = "Clear NVRAM";
clearItem->module = m;
clearItem->module = module;
clearItem->preserveVRAM = true;
clearItem->preserveNVRAM = false;
menu->addChild(clearItem);
Expand Down

0 comments on commit 7870c28

Please sign in to comment.