Skip to content

Commit

Permalink
Merge pull request #4 from saleae/fix/framev2-byte
Browse files Browse the repository at this point in the history
Fix single byte encoding in FrameV2
  • Loading branch information
JohnColanduoni authored May 18, 2020
2 parents 0e2ae7e + f3020dd commit 7551acb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/SpiAnalyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,13 @@ void SpiAnalyzer::GetWord()
mResults->AddFrame( result_frame );

FrameV2 framev2;
framev2.AddInteger( "mosi", mosi_word );
framev2.AddInteger( "miso", miso_word );
if (bits_per_transfer <= 8) {
framev2.AddByte("mosi", static_cast<U8>(mosi_word));
framev2.AddByte("miso", static_cast<U8>(miso_word));
} else {
framev2.AddInteger( "mosi", mosi_word );
framev2.AddInteger( "miso", miso_word );
}
mResults->AddFrameV2( framev2, "result", first_sample, mClock->GetSampleNumber() + 1 );

mResults->CommitResults();
Expand Down

0 comments on commit 7551acb

Please sign in to comment.