[chirp_devel] [PATCH 1 of 4] [RT22] Retevis RT22 Driver Cleanup for better PEP8 Compliance

Jim Unroe
Wed Dec 16 20:09:08 PST 2020


# HG changeset patch
# User Jim Unroe <rock.unroe at gmail.com>
# Date 1608175030 18000
#      Wed Dec 16 22:17:10 2020 -0500
# Node ID 7f25fd339d4e4f7a4cbc9925a2e1c6ce6bf28b9d
# Parent  8d906ccd00db039eee18a8af23c87ed4d2d6f127
[RT22] Retevis RT22 Driver Cleanup for better PEP8 Compliance

Clean up driver before adding another radio ID and support for additional
radio models.

related to #6467

diff -r 8d906ccd00db -r 7f25fd339d4e chirp/drivers/retevis_rt22.py
--- a/chirp/drivers/retevis_rt22.py	Thu Nov 26 21:59:58 2020 -0500
+++ b/chirp/drivers/retevis_rt22.py	Wed Dec 16 22:17:10 2020 -0500
@@ -30,32 +30,32 @@
 MEM_FORMAT = """
 #seekto 0x0010;
 struct {
-  lbcd rxfreq[4];                
-  lbcd txfreq[4];                
-  ul16 rx_tone;                  
-  ul16 tx_tone;                  
-  u8 unknown1;                   
-  u8 unknown3:2,                 
-     highpower:1, // Power Level 
-     wide:1,      // Bandwidth   
-     unknown4:4;                 
+  lbcd rxfreq[4];
+  lbcd txfreq[4];
+  ul16 rx_tone;
+  ul16 tx_tone;
+  u8 unknown1;
+  u8 unknown3:2,
+     highpower:1, // Power Level
+     wide:1,      // Bandwidth
+     unknown4:4;
   u8 unknown5[2];
 } memory[16];
 
 #seekto 0x012F;
 struct {
   u8 voice;       // Voice Annunciation
-  u8 tot;         // Time-out Timer                   
+  u8 tot;         // Time-out Timer
   u8 unknown1[3];
   u8 squelch;     // Squelch Level
-  u8 save;        // Battery Saver                    
-  u8 beep;        // Beep                             
+  u8 save;        // Battery Saver
+  u8 beep;        // Beep
   u8 unknown2[2];
   u8 vox;         // VOX
   u8 voxgain;     // VOX Gain
-  u8 voxdelay;    // VOX Delay                        
+  u8 voxdelay;    // VOX Delay
   u8 unknown3[2];
-  u8 pf2key;      // PF2 Key                          
+  u8 pf2key;      // PF2 Key
 } settings;
 
 #seekto 0x017E;
@@ -617,7 +617,7 @@
         # testing the file data size
         if len(filedata) in [0x0408, ]:
             match_size = True
-        
+
         # testing the model fingerprint
         match_model = model_match(cls, filedata)
 
@@ -626,24 +626,28 @@
         else:
             return False
 
+
 @directory.register
 class KDC1(RT22Radio):
     """WLN KD-C1"""
     VENDOR = "WLN"
     MODEL = "KD-C1"
 
+
 @directory.register
 class ZTX6(RT22Radio):
     """Zastone ZT-X6"""
     VENDOR = "Zastone"
     MODEL = "ZT-X6"
 
+
 @directory.register
 class LT316(RT22Radio):
     """Luiton LT-316"""
     VENDOR = "LUITON"
     MODEL = "LT-316"
 
+
 @directory.register
 class TDM8(RT22Radio):
     VENDOR = "TID"
diff -r 8d906ccd00db -r 7f25fd339d4e tools/cpep8.manifest
--- a/tools/cpep8.manifest	Thu Nov 26 21:59:58 2020 -0500
+++ b/tools/cpep8.manifest	Wed Dec 16 22:17:10 2020 -0500
@@ -70,6 +70,7 @@
 ./chirp/drivers/leixen.py
 ./chirp/drivers/puxing.py
 ./chirp/drivers/radioddity_r2.py
+./chirp/drivers/retevis_rt22.py
 ./chirp/drivers/rfinder.py
 ./chirp/drivers/template.py
 ./chirp/drivers/th350.py



More information about the chirp_devel mailing list