@@ -1115,22 +1115,8 @@ void handleGnssDataTask(void *e)
11151115// This is only called if ticker task is started so no pin tests are done
11161116void tickerBluetoothLedUpdate ()
11171117{
1118- // Blink on/off while we wait for BT connection
1119- if (bluetoothGetState () == BT_NOTCONNECTED)
1120- {
1121- if (btFadeLevel == 0 )
1122- btFadeLevel = 255 ;
1123- else
1124- btFadeLevel = 0 ;
1125- ledcWrite (ledBtChannel, btFadeLevel);
1126- }
1127-
1128- // Solid LED if BT Connected
1129- else if (bluetoothGetState () == BT_CONNECTED)
1130- ledcWrite (ledBtChannel, 255 );
1131-
1132- // Pulse LED while no BT and we wait for WiFi connection
1133- else if (wifiState == WIFI_STATE_CONNECTING || wifiState == WIFI_STATE_CONNECTED)
1118+ // If we are in WiFi config mode, fade LED
1119+ if (inWiFiConfigMode () == true )
11341120 {
11351121 // Fade in/out the BT LED during WiFi AP mode
11361122 btFadeLevel += pwmFadeAmount;
@@ -1144,6 +1130,18 @@ void tickerBluetoothLedUpdate()
11441130
11451131 ledcWrite (ledBtChannel, btFadeLevel);
11461132 }
1133+ // Blink on/off while we wait for BT connection
1134+ else if (bluetoothGetState () == BT_NOTCONNECTED)
1135+ {
1136+ if (btFadeLevel == 0 )
1137+ btFadeLevel = 255 ;
1138+ else
1139+ btFadeLevel = 0 ;
1140+ ledcWrite (ledBtChannel, btFadeLevel);
1141+ }
1142+ // Solid LED if BT Connected
1143+ else if (bluetoothGetState () == BT_CONNECTED)
1144+ ledcWrite (ledBtChannel, 255 );
11471145 else
11481146 ledcWrite (ledBtChannel, 0 );
11491147}
0 commit comments