From f3020dd32c0439553f43830244a6f35d6551cb8d Mon Sep 17 00:00:00 2001 From: John Colanduoni Date: Mon, 18 May 2020 12:14:07 -0700 Subject: [PATCH] Fix byte encoding in FrameV2 --- src/SpiAnalyzer.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/SpiAnalyzer.cpp b/src/SpiAnalyzer.cpp index 25a7239..8aa60b6 100644 --- a/src/SpiAnalyzer.cpp +++ b/src/SpiAnalyzer.cpp @@ -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(mosi_word)); + framev2.AddByte("miso", static_cast(miso_word)); + } else { + framev2.AddInteger( "mosi", mosi_word ); + framev2.AddInteger( "miso", miso_word ); + } mResults->AddFrameV2( framev2, "result", first_sample, mClock->GetSampleNumber() + 1 ); mResults->CommitResults();