MCPcopy Create free account
hub / github.com/BruceDevices/firmware / optionsMenu

Method optionsMenu

src/core/menu_items/FileMenu.cpp:10–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8#include "core/connect/serial_commands.h"
9
10void FileMenu::optionsMenu() {
11 options.clear();
12 if (setupSdCard()) options.push_back({"SD Card", [=]() { loopSD(SD); }});
13 options.push_back({"LittleFS", [=]() { loopSD(LittleFS); }});
14 options.push_back({"WebUI", loopOptionsWebUi});
15
16#if !defined(LITE_VERSION)
17 options.push_back({"Connect", [=]() {
18 std::vector<Option> connectOpts = {
19 {"Send File", [=]() { FileSharing().sendFile(); } },
20 {"Recv File", [=]() { FileSharing().receiveFile(); } },
21 {"Send Cmds", [=]() { EspSerialCmd().sendCommands(); } },
22 {"Recv Cmds", [=]() { EspSerialCmd().receiveCommands(); }},
23 {"Back", [=]() { optionsMenu(); } }
24 };
25 loopOptions(connectOpts, MENU_TYPE_SUBMENU, "Connect");
26 }});
27#endif
28
29#if defined(SOC_USB_OTG_SUPPORTED)
30 options.push_back({"Mass Storage", [=]() { MassStorage(); }});
31#endif
32 addOptionToMainMenu();
33
34 loopOptions(options, MENU_TYPE_SUBMENU, "Files");
35}
36void FileMenu::drawIcon(float scale) {
37 clearIconArea();
38 int iconW = scale * 32;

Callers

nothing calls this directly

Calls 12

setupSdCardFunction · 0.85
loopSDFunction · 0.85
FileSharingClass · 0.85
EspSerialCmdClass · 0.85
MassStorageClass · 0.85
addOptionToMainMenuFunction · 0.85
sendFileMethod · 0.80
receiveFileMethod · 0.80
sendCommandsMethod · 0.80
receiveCommandsMethod · 0.80
loopOptionsFunction · 0.50
clearMethod · 0.45

Tested by

no test coverage detected