@@ -57,21 +57,21 @@ static bool isPowered()
5757
5858static void sdsEnter ()
5959{
60- LOG_DEBUG (" State: SDS" );
60+ LOG_POWERFSM (" State: SDS" );
6161 // FIXME - make sure GPS and LORA radio are off first - because we want close to zero current draw
6262 doDeepSleep (Default::getConfiguredOrDefaultMs (config.power .sds_secs ), false , false );
6363}
6464
6565static void lowBattSDSEnter ()
6666{
67- LOG_DEBUG (" State: Lower batt SDS" );
67+ LOG_POWERFSM (" State: Lower batt SDS" );
6868 doDeepSleep (Default::getConfiguredOrDefaultMs (config.power .sds_secs ), false , true );
6969}
7070extern Power *power;
7171
7272static void shutdownEnter ()
7373{
74- LOG_DEBUG (" State: SHUTDOWN" );
74+ LOG_POWERFSM (" State: SHUTDOWN" );
7575 shutdownAtMsec = millis ();
7676}
7777
@@ -81,7 +81,7 @@ static uint32_t secsSlept;
8181
8282static void lsEnter ()
8383{
84- LOG_INFO (" lsEnter begin, ls_secs=%u" , config.power .ls_secs );
84+ LOG_POWERFSM (" lsEnter begin, ls_secs=%u" , config.power .ls_secs );
8585 if (screen)
8686 screen->setOn (false );
8787 secsSlept = 0 ; // How long have we been sleeping this time
@@ -155,12 +155,12 @@ static void lsIdle()
155155
156156static void lsExit ()
157157{
158- LOG_INFO ( " Exit state: LS " );
158+ LOG_POWERFSM ( " State: lsExit " );
159159}
160160
161161static void nbEnter ()
162162{
163- LOG_DEBUG (" State: NB " );
163+ LOG_POWERFSM (" State: nbEnter " );
164164 if (screen)
165165 screen->setOn (false );
166166#ifdef ARCH_ESP32
@@ -173,14 +173,15 @@ static void nbEnter()
173173
174174static void darkEnter ()
175175{
176+ LOG_POWERFSM (" State: darkEnter" );
176177 setBluetoothEnable (true );
177178 if (screen)
178179 screen->setOn (false );
179180}
180181
181182static void serialEnter ()
182183{
183- LOG_DEBUG (" State: SERIAL " );
184+ LOG_POWERFSM (" State: serialEnter " );
184185 setBluetoothEnable (false );
185186 if (screen) {
186187 screen->setOn (true );
@@ -189,13 +190,14 @@ static void serialEnter()
189190
190191static void serialExit ()
191192{
193+ LOG_POWERFSM (" State: serialExit" );
192194 // Turn bluetooth back on when we leave serial stream API
193195 setBluetoothEnable (true );
194196}
195197
196198static void powerEnter ()
197199{
198- // LOG_DEBUG ("State: POWER ");
200+ LOG_POWERFSM (" State: powerEnter " );
199201 if (!isPowered ()) {
200202 // If we got here, we are in the wrong state - we should be in powered, let that state handle things
201203 LOG_INFO (" Loss of power in Powered" );
@@ -210,6 +212,7 @@ static void powerEnter()
210212
211213static void powerIdle ()
212214{
215+ // LOG_POWERFSM("State: powerIdle"); // very chatty
213216 if (!isPowered ()) {
214217 // If we got here, we are in the wrong state
215218 LOG_INFO (" Loss of power in Powered" );
@@ -219,19 +222,21 @@ static void powerIdle()
219222
220223static void powerExit ()
221224{
225+ LOG_POWERFSM (" State: powerExit" );
222226 setBluetoothEnable (true );
223227}
224228
225229static void onEnter ()
226230{
227- LOG_DEBUG (" State: ON " );
231+ LOG_POWERFSM (" State: onEnter " );
228232 if (screen)
229233 screen->setOn (true );
230234 setBluetoothEnable (true );
231235}
232236
233237static void onIdle ()
234238{
239+ LOG_POWERFSM (" State: onIdle" );
235240 if (isPowered ()) {
236241 // If we got here, we are in the wrong state - we should be in powered, let that state handle things
237242 powerFSM.trigger (EVENT_POWER_CONNECTED);
@@ -240,7 +245,7 @@ static void onIdle()
240245
241246static void bootEnter ()
242247{
243- LOG_DEBUG (" State: BOOT " );
248+ LOG_POWERFSM (" State: bootEnter " );
244249}
245250
246251State stateSHUTDOWN (shutdownEnter, NULL , NULL , " SHUTDOWN" );
@@ -317,11 +322,6 @@ void PowerFSM_setup()
317322 // if any packet destined for phone arrives, turn on bluetooth at least
318323 powerFSM.add_transition (&stateNB, &stateDARK, EVENT_PACKET_FOR_PHONE, NULL , " Packet for phone" );
319324
320- // Removed 2.7: we don't show the nodes individually for every node on the screen anymore
321- // powerFSM.add_transition(&stateNB, &stateON, EVENT_NODEDB_UPDATED, NULL, "NodeDB update");
322- // powerFSM.add_transition(&stateDARK, &stateON, EVENT_NODEDB_UPDATED, NULL, "NodeDB update");
323- // powerFSM.add_transition(&stateON, &stateON, EVENT_NODEDB_UPDATED, NULL, "NodeDB update");
324-
325325 // Show the received text message
326326 powerFSM.add_transition (&stateLS, &stateON, EVENT_RECEIVED_MSG, NULL , " Received text" );
327327 powerFSM.add_transition (&stateNB, &stateON, EVENT_RECEIVED_MSG, NULL , " Received text" );
0 commit comments