@@ -1115,22 +1115,8 @@ void handleGnssDataTask(void *e)
1115
1115
// This is only called if ticker task is started so no pin tests are done
1116
1116
void tickerBluetoothLedUpdate ()
1117
1117
{
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 )
1134
1120
{
1135
1121
// Fade in/out the BT LED during WiFi AP mode
1136
1122
btFadeLevel += pwmFadeAmount;
@@ -1144,6 +1130,18 @@ void tickerBluetoothLedUpdate()
1144
1130
1145
1131
ledcWrite (ledBtChannel, btFadeLevel);
1146
1132
}
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 );
1147
1145
else
1148
1146
ledcWrite (ledBtChannel, 0 );
1149
1147
}
0 commit comments