Skip to content

Commit

Permalink
Removed chance of messing up FSM by async calls from Internet activit…
Browse files Browse the repository at this point in the history
…ies. Always invoke stop through the fsm ponter.
  • Loading branch information
MartinMueller2003 authored Sep 26, 2023
1 parent a4b5b8b commit 30599c5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ESPixelStick/src/input/InputFPPRemotePlayEffectFsm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ void fsm_PlayEffect_state_PlayingEffect::Poll ()
if (p_InputFPPRemotePlayEffect->PlayEffectTimer.IsExpired())
{
// DEBUG_V ("");
Stop ();
p_InputFPPRemotePlayEffect->Stop ();
}

// DEBUG_END;
Expand Down
10 changes: 5 additions & 5 deletions ESPixelStick/src/input/InputFPPRemotePlayFileFsm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ void fsm_PlayFile_state_PlayingFile::Poll ()
{
// DEBUG_V (String ("TotalNumberOfFramesInSequence: ") + String (p_Parent->TotalNumberOfFramesInSequence));
// DEBUG_V (String (" Done Playing:: FileName: '") + p_Parent->GetFileName () + "'");
Stop ();
p_Parent->Stop ();
break;
}
}
Expand Down Expand Up @@ -285,7 +285,7 @@ IRAM_ATTR void fsm_PlayFile_state_PlayingFile::TimerPoll ()
// xDEBUG_V (String (" CurrentFrame: ") + String (CurrentFrame));

// logcon (F ("File Playback Failed to read enough data"));
Stop ();
p_Parent->Stop ();
}
}

Expand Down Expand Up @@ -316,7 +316,7 @@ void fsm_PlayFile_state_PlayingFile::Init (c_InputFPPRemotePlayFile* Parent)
// DEBUG_V (String ("RemainingPlayCount: ") + p_Parent->RemainingPlayCount);
if (0 == p_Parent->RemainingPlayCount)
{
Stop ();
p_Parent->Stop ();
break;
}

Expand Down Expand Up @@ -355,7 +355,7 @@ void fsm_PlayFile_state_PlayingFile::Start (String& FileName, float ElapsedSecon
// DEBUG_V (String ("TotalNumberOfFramesInSequence: ") + String (p_Parent->TotalNumberOfFramesInSequence));
// DEBUG_V (String ("RemainingPlayCount: ") + p_Parent->RemainingPlayCount);

Stop ();
p_Parent->Stop ();
p_Parent->Start (FileName, ElapsedSeconds, PlayCount);

// DEBUG_END;
Expand Down Expand Up @@ -393,7 +393,7 @@ bool fsm_PlayFile_state_PlayingFile::Sync (String& FileName, float ElapsedSecond
if (FileName != p_Parent->GetFileName ())
{
// DEBUG_V ("Sync: Filename change");
Stop ();
p_Parent->Stop ();
p_Parent->Start (FileName, ElapsedSeconds, 1);
break;
}
Expand Down
6 changes: 3 additions & 3 deletions ESPixelStick/src/input/InputFPPRemotePlayListFsm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ void fsm_PlayList_state_PlayingFile::Poll ()
if (pInputFPPRemotePlayList->pInputFPPRemotePlayItem->IsIdle ())
{
// DEBUG_V ("Done with all entries");
Stop ();
pInputFPPRemotePlayList->Stop ();
}

// DEBUG_END;
Expand Down Expand Up @@ -236,7 +236,7 @@ void fsm_PlayList_state_PlayingEffect::Poll ()
if (pInputFPPRemotePlayList->pInputFPPRemotePlayItem->IsIdle ())
{
// DEBUG_V ("Effect Processing Done");
Stop ();
pInputFPPRemotePlayList->Stop ();
}

// DEBUG_END;
Expand Down Expand Up @@ -311,7 +311,7 @@ void fsm_PlayList_state_Paused::Poll ()

if (pInputFPPRemotePlayList->PauseDelayTimer.IsExpired())
{
Stop();
pInputFPPRemotePlayList->Stop();
}

// DEBUG_END;
Expand Down

0 comments on commit 30599c5

Please sign in to comment.