Skip to content

Commit

Permalink
Merge pull request #5 from saleae/feature/framev2-enable-disable
Browse files Browse the repository at this point in the history
Add "Enable" and "Disable" FrameV2 events when enable signal changes state.
  • Loading branch information
Marcus10110 authored Jun 5, 2020
2 parents 4ab519e + ee6cacf commit 182d58d
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/SpiAnalyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,14 @@ void SpiAnalyzer::AdvanceToActiveEnableEdgeWithCorrectClockPolarity()
for( ;; )
{
if( IsInitialClockPolarityCorrect() == true ) // if false, this function moves to the next active enable edge.
{
if( mEnable )
{
FrameV2 frame_v2_start_of_transaction;
mResults->AddFrameV2( frame_v2_start_of_transaction, "enable", mCurrentSample, mCurrentSample + 1 );
}
break;
}
}
}

Expand Down Expand Up @@ -173,6 +180,13 @@ bool SpiAnalyzer::WouldAdvancingTheClockToggleEnable()
U64 next_edge = mClock->GetSampleOfNextEdge();
bool enable_will_toggle = mEnable->WouldAdvancingToAbsPositionCauseTransition( next_edge );

if( enable_will_toggle )
{
U64 enable_edge = mEnable->GetSampleOfNextEdge();
FrameV2 frame_v2_end_of_transaction;
mResults->AddFrameV2( frame_v2_end_of_transaction, "disable", enable_edge, enable_edge + 1 );
}

if( enable_will_toggle == false )
return false;
else
Expand Down Expand Up @@ -278,7 +292,7 @@ void SpiAnalyzer::GetWord()
}
}

// save the resuls:
// save the results:
U32 count = mArrowLocations.size();
for( U32 i = 0; i < count; i++ )
mResults->AddMarker( mArrowLocations[ i ], mArrowMarker, mSettings->mClockChannel );
Expand Down

0 comments on commit 182d58d

Please sign in to comment.