From 1d249ff8aca98b8ad42b8ca39c5ac3d63d727080 Mon Sep 17 00:00:00 2001 From: dreamsourcelabTAI Date: Thu, 28 Jul 2022 17:10:55 +0800 Subject: [PATCH] fix: the export data of annotation have't sort by time, about 1-spi protocol --- libsigrokdecode4DSL/decoders/1-spi/pd.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libsigrokdecode4DSL/decoders/1-spi/pd.py b/libsigrokdecode4DSL/decoders/1-spi/pd.py index d094dcf4..9903223c 100644 --- a/libsigrokdecode4DSL/decoders/1-spi/pd.py +++ b/libsigrokdecode4DSL/decoders/1-spi/pd.py @@ -189,10 +189,14 @@ class Decoder(srd.Decoder): # Bit annotations. if self.have_miso: - for bit in self.misobits: + blen = len(self.misobits) + for i in range(0, blen): + bit = self.misobits[blen-i-1] self.put(bit[1], bit[2], self.out_ann, [2, ['%d' % bit[0]]]) if self.have_mosi: - for bit in self.mosibits: + blen = len(self.mosibits) + for i in range(0, blen): + bit = self.mosibits[blen-i-1] self.put(bit[1], bit[2], self.out_ann, [3, ['%d' % bit[0]]]) # Dataword annotations.