File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -86,11 +86,18 @@ def get_tgpio_digital(self, ionum=None):
86
86
# only available in Lite6
87
87
ret = self .arm_cmd .tgpio_addr_r16 (0x0A12 )
88
88
return ret [0 ], ret [1 ] & 0x0001
89
- else :
89
+ elif isinstance ( ionum , int ) :
90
90
ret = self .arm_cmd .tgpio_get_digital ()
91
91
if ret [0 ] == 0 :
92
92
self .tgpio_state ['digital' ] = ret [1 :]
93
- return ret [0 ], ret [1 :] if ionum is None else ret [ionum + 1 if ionum < 3 else ionum ]
93
+ return ret [0 ], ret [ionum + 1 if ionum < 3 else ionum ]
94
+ else :
95
+ ret1 = self .arm_cmd .tgpio_addr_r16 (0x0A12 )
96
+ ret2 = self .arm_cmd .tgpio_get_digital ()
97
+ if ret2 [0 ] == 0 :
98
+ self .tgpio_state ['digital' ] = ret2 [1 :]
99
+ ret2 .insert (3 , ret1 [1 ])
100
+ return ret1 [0 ] or ret2 [0 ], ret2 [1 :]
94
101
95
102
@xarm_is_connected (_type = 'get' )
96
103
def get_tgpio_output_digital (self , ionum = None ):
You can’t perform that action at this time.
0 commit comments