@@ -167,10 +167,29 @@ def initialize(self):
167167 "Check your configuration." )
168168 self .channel_setup [channel ] = False
169169 else :
170+ cmd = f"pinctrl set { self .options_channels ['pin_1' ][channel ]} op dl"
171+ cmd_return , cmd_error , cmd_status = cmd_output (cmd , user = "root" )
172+ self .logger .debug (
173+ f"GPIO { self .options_channels ['pin_1' ][channel ]} setup with '{ cmd } ': "
174+ f"Status: { cmd_status } , Return: { cmd_return } , Error: { cmd_error } " )
175+
176+ cmd = f"pinctrl set { self .options_channels ['pin_2' ][channel ]} op dl"
177+ cmd_return , cmd_error , cmd_status = cmd_output (cmd , user = "root" )
178+ self .logger .debug (
179+ f"GPIO { self .options_channels ['pin_2' ][channel ]} setup with '{ cmd } ': "
180+ f"Status: { cmd_status } , Return: { cmd_return } , Error: { cmd_error } " )
181+
182+ cmd = f"pinctrl set { self .options_channels ['pin_enable' ][channel ]} op dl"
183+ cmd_return , cmd_error , cmd_status = cmd_output (cmd , user = "root" )
184+ self .logger .debug (
185+ f"GPIO { self .options_channels ['pin_enable' ][channel ]} setup with '{ cmd } ': "
186+ f"Status: { cmd_status } , Return: { cmd_return } , Error: { cmd_error } " )
187+
170188 self .channel_setup [channel ] = True
171- self .output_setup = True
172189 self .output_states [channel ] = False
173190
191+ self .output_setup = True
192+
174193 def output_switch (self , state , output_type = None , amount = None , output_channel = None ):
175194 if not self .is_setup ():
176195 msg = "Error 101: Device not set up. " \
@@ -280,6 +299,7 @@ def switch_pin(self, pin, state):
280299 set_opt = "dl"
281300 cmd = f"pinctrl set { pin } { set_opt } "
282301 cmd_return , cmd_error , cmd_status = cmd_output (cmd , user = "root" )
302+ state_text = 'ON' if state else 'OFF'
283303 self .logger .debug (
284- f"GPIO { self . options_channels [ ' pin' ][ 0 ] } set ON with '{ cmd } ': "
304+ f"GPIO { pin } set { state_text } with '{ cmd } ': "
285305 f"Status: { cmd_status } , Return: { cmd_return } , Error: { cmd_error } " )
0 commit comments