]> sigrok.org Git - libsigrokdecode.git/commitdiff
adxl345: Update register meaning for 0x21, 0x22, 0x23 regs.
authorTeo Perisanu <redacted>
Tue, 5 May 2020 09:46:34 +0000 (12:46 +0300)
committerUwe Hermann <redacted>
Thu, 21 May 2020 14:43:09 +0000 (16:43 +0200)
On the Data row, the content of the single-byte registers is decoded as
follows: '<Meaning> <Value> <Unit>'. Initially, the meaning for these
registers was misplaced. This commit updates these meanings as they
really are.

Signed-off-by: Teo Perisanu <redacted>
decoders/adxl345/pd.py

index bc442bac4b67e026e12971d5090dc202a34cff08..2d53e4c0d17bf249658098feddecd918404243af 100644 (file)
@@ -174,20 +174,19 @@ class Decoder(srd.Decoder):
         self.handle_reg_with_scaling_factor(data, 15.6, 'OFSZ', 'g', None)
 
     def handle_reg_0x21(self, data):
-        self.handle_reg_with_scaling_factor(data, 0.625, 'Time', 's',
+        self.handle_reg_with_scaling_factor(data, 0.625, 'Duration', 's',
             error_messages['dis_single_double'])
 
     def handle_reg_0x22(self, data):
-        self.handle_reg_with_scaling_factor(data, 1.25, 'Latent', 's',
+        self.handle_reg_with_scaling_factor(data, 1.25, 'Latency', 's',
             error_messages['dis_double'])
 
     def handle_reg_0x23(self, data):
-        self.handle_reg_with_scaling_factor(data, 1.25, 'Latent', 's',
+        self.handle_reg_with_scaling_factor(data, 1.25, 'Window', 's',
             error_messages['dis_double'])
 
     def handle_reg_0x24(self, data):
-        self.handle_reg_with_scaling_factor(data, 62.5, 'Latent', 's',
-            error_messages['undesirable'])
+        self.handle_reg_0x1d(data)
 
     def handle_reg_0x25(self, data):
         self.handle_reg_0x1d(data)