@@ -166,21 +166,28 @@ void bluetoothStart()
166
166
else if (settings.bluetoothRadioType == BLUETOOTH_RADIO_BLE)
167
167
bluetoothSerial = new BTLESerial ();
168
168
169
- if (pinBluetoothTaskHandle == nullptr )
170
- xTaskCreatePinnedToCore (
171
- pinBluetoothTask,
172
- " BluetoothStart " , // Just for humans
173
- 2000 , // Stack Size
174
- nullptr , // Task input parameter
175
- 0 , // Priority, with 3 (configMAX_PRIORITIES - 1) being the highest, and 0 being the lowest
176
- &pinBluetoothTaskHandle, // Task handle
177
- settings. bluetoothInterruptsCore ); // Core where task should run, 0=core, 1=Arduino
178
-
179
- while (bluetoothPinned == false ) // Wait for task to run once
180
- delay ( 1 );
181
-
169
+ // Not yet implemented
170
+ // if (pinBluetoothTaskHandle == nullptr)
171
+ // xTaskCreatePinnedToCore(
172
+ // pinBluetoothTask,
173
+ // "BluetoothStart", // Just for humans
174
+ // 2000 , // Stack Size
175
+ // nullptr, // Task input parameter
176
+ // 0, // Priority, with 3 (configMAX_PRIORITIES - 1) being the highest, and 0 being the
177
+ // lowest &pinBluetoothTaskHandle, // Task handle settings.bluetoothInterruptsCore); //
178
+ // Core where task should run, 0=core, 1=Arduino
179
+
180
+ // while (bluetoothPinned == false) // Wait for task to run once
181
+ // delay(1);
182
182
183
+ if (bluetoothSerial->begin (deviceName) == false )
184
+ {
185
+ systemPrintln (" An error occurred initializing Bluetooth" );
183
186
187
+ if (productVariant == RTK_SURVEYOR)
188
+ digitalWrite (pin_bluetoothStatusLED, LOW);
189
+ return ;
190
+ }
184
191
185
192
// Set PIN to 1234 so we can connect to older BT devices, but not require a PIN for modern device pairing
186
193
// See issue: https://github.com/sparkfun/SparkFun_RTK_Firmware/issues/5
@@ -227,14 +234,13 @@ void bluetoothStart()
227
234
// https://github.com/espressif/arduino-esp32/issues/3386
228
235
void pinBluetoothTask (void *pvParameters)
229
236
{
237
+ if (bluetoothSerial->begin (deviceName) == false )
238
+ {
239
+ systemPrintln (" An error occurred initializing Bluetooth" );
230
240
231
- if (bluetoothSerial->begin (deviceName) == false )
232
- {
233
- systemPrintln (" An error occurred initializing Bluetooth" );
234
-
235
- if (productVariant == RTK_SURVEYOR)
236
- digitalWrite (pin_bluetoothStatusLED, LOW);
237
- }
241
+ if (productVariant == RTK_SURVEYOR)
242
+ digitalWrite (pin_bluetoothStatusLED, LOW);
243
+ }
238
244
239
245
bluetoothPinned = true ;
240
246
@@ -252,7 +258,7 @@ void bluetoothStop()
252
258
bluetoothSerial->flush (); // Complete any transfers
253
259
bluetoothSerial->disconnect (); // Drop any clients
254
260
bluetoothSerial->end (); // bluetoothSerial->end() will release significant RAM (~100k!) but a
255
- // bluetoothSerial->start will crash.
261
+ // bluetoothSerial->start will crash.
256
262
257
263
log_d (" Bluetooth turned off" );
258
264
0 commit comments