Skip to content

Commit fb18f9a

Browse files
authored
Fixed Bluetooth NVS variables #1531 (#1532)
1 parent d470f15 commit fb18f9a

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

FluidNC/src/BTConfig.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,7 @@ namespace WebUI {
3939
return SerialBT.write(data);
4040
}
4141

42-
BTConfig::BTConfig(const char* name) : Module(name) {
43-
bt_enable = new EnumSetting("Bluetooth Enable", WEBSET, WA, "ESP141", "Bluetooth/Enable", 1, &onoffOptions);
44-
45-
bt_name = new BTNameSetting("Bluetooth name", "ESP140", "Bluetooth/Name", DEFAULT_BT_NAME);
46-
}
42+
BTConfig::BTConfig(const char* name) : Module(name) {}
4743

4844
void BTConfig::my_spp_cb(esp_spp_cb_event_t event, esp_spp_cb_param_t* param) {
4945
switch (event) {
@@ -113,7 +109,9 @@ namespace WebUI {
113109
}
114110

115111
void BTConfig::init() {
116-
log_debug("Begin Bluetooth setup");
112+
bt_enable = new EnumSetting("Bluetooth Enable", WEBSET, WA, "ESP141", "Bluetooth/Enable", 1, &onoffOptions);
113+
bt_name = new BTNameSetting("Bluetooth name", "ESP140", "Bluetooth/Name", DEFAULT_BT_NAME);
114+
117115
//stop active services
118116
deinit();
119117

@@ -129,6 +127,7 @@ namespace WebUI {
129127

130128
SerialBT.register_callback(&my_spp_cb);
131129
log_info("BT Started with " << _btname);
130+
log_debug("Heap: " << xPortGetFreeHeapSize());
132131
allChannels.registration(&btChannel);
133132
return;
134133
}

0 commit comments

Comments
 (0)