@@ -88,6 +88,7 @@ class KISS():
88
88
CMD_DISP_RCND = 0x68
89
89
CMD_BT_CTRL = 0x46
90
90
CMD_BT_PIN = 0x62
91
+ CMD_DIS_IA = 0x69
91
92
CMD_BOARD = 0x47
92
93
CMD_PLATFORM = 0x48
93
94
CMD_MCU = 0x49
@@ -689,6 +690,16 @@ def recondition_display(self):
689
690
if written != len (kiss_command ):
690
691
raise IOError ("An IO error occurred while sending display recondition command to device" )
691
692
693
+ def set_disable_interference_avoidance (self , ia_disabled ):
694
+ if ia_disabled :
695
+ data = bytes ([0x01 ])
696
+ else :
697
+ data = bytes ([0x00 ])
698
+ kiss_command = bytes ([KISS .FEND ])+ bytes ([KISS .CMD_DIS_IA ])+ data + bytes ([KISS .FEND ])
699
+ written = self .serial .write (kiss_command )
700
+ if written != len (kiss_command ):
701
+ raise IOError ("An IO error occurred while sending interference avoidance configuration command to device" )
702
+
692
703
def set_neopixel_intensity (self , intensity ):
693
704
data = bytes ([intensity & 0xFF ])
694
705
kiss_command = bytes ([KISS .FEND ])+ bytes ([KISS .CMD_NP_INT ])+ data + bytes ([KISS .FEND ])
@@ -1335,6 +1346,9 @@ def main():
1335
1346
parser .add_argument ("--sf" , action = "store" , metavar = "factor" , type = int , default = None , help = "Spreading factor for TNC mode (7 - 12)" )
1336
1347
parser .add_argument ("--cr" , action = "store" , metavar = "rate" , type = int , default = None , help = "Coding rate for TNC mode (5 - 8)" )
1337
1348
1349
+ parser .add_argument ("-x" , "--ia-enable" , action = "store_true" , help = "Enable interference avoidance" )
1350
+ parser .add_argument ("-X" , "--ia-disable" , action = "store_true" , help = "Disable interference avoidance" )
1351
+
1338
1352
parser .add_argument ("--eeprom-backup" , action = "store_true" , help = "Backup EEPROM to file" )
1339
1353
parser .add_argument ("--eeprom-dump" , action = "store_true" , help = "Dump EEPROM to console" )
1340
1354
parser .add_argument ("--eeprom-wipe" , action = "store_true" , help = "Unlock and wipe EEPROM" )
@@ -3434,6 +3448,16 @@ def get_flasher_call(platform, fw_filename):
3434
3448
RNS .log ("Starting display reconditioning" )
3435
3449
rnode .recondition_display ()
3436
3450
3451
+ if isinstance (args .ia_enable , bool ):
3452
+ if args .ia_enable :
3453
+ RNS .log ("Enabling interference avoidance" )
3454
+ rnode .set_disable_interference_avoidance (False )
3455
+
3456
+ if isinstance (args .ia_disable , bool ):
3457
+ if args .ia_disable :
3458
+ RNS .log ("Disabling interference avoidance" )
3459
+ rnode .set_disable_interference_avoidance (True )
3460
+
3437
3461
if isinstance (args .np , int ):
3438
3462
di = args .np
3439
3463
if di < 0 :
0 commit comments