1- from config import config
21import logging
32import os
43import re
54import subprocess
65import sys
7- from typing import Optional
6+
7+ from config import config
8+
89
910PWM_FULL_RE = re .compile (
1011 r"(PWM\d+)(?:_CHAN(\d+)|_(\d+))" ,
@@ -22,12 +23,11 @@ def createPWM() -> 'basicPWM':
2223 if ',' in config ['DynRDSAdvPIPWMPin' ]:
2324 logging .info ('Using hardware PWM config: %s' , config ['DynRDSAdvPIPWMPin' ])
2425 return hardwarePWM (int (config ['DynRDSAdvPIPWMPin' ].split (',' , 1 )[0 ]))
25- else :
26- logging .info ('Using software PWM pin: %s' , config ['DynRDSAdvPIPWMPin' ])
27- return softwarePWM (int (config ['DynRDSAdvPIPWMPin' ]))
26+ logging .info ('Using software PWM pin: %s' , config ['DynRDSAdvPIPWMPin' ])
27+ return softwarePWM (int (config ['DynRDSAdvPIPWMPin' ]))
2828 case 'BeagleBone Black' :
29- logging .info ('Using BBB hardware PWM config: %s' , config ['DynRDSAdvBBBPWMPin' ])
30- return hardwareBBBPWM (config ['DynRDSAdvBBBPWMPin' ])
29+ logging .info ('Using BBB hardware PWM config: %s' , config ['DynRDSAdvBBBPWMPin' ])
30+ return hardwareBBBPWM (config ['DynRDSAdvBBBPWMPin' ])
3131 case _:
3232 logging .warning ('Unknown platform: %s, PWM disabled' , platform )
3333 return basicPWM ()
@@ -69,7 +69,7 @@ def __init__(self, pwmGPIOPin=18):
6969
7070 super ().__init__ ()
7171
72- def _getPWMInfoFromPinctrl (eslf , gpioPin = 18 ):
72+ def _getPWMInfoFromPinctrl (self , gpioPin = 18 ):
7373 try :
7474 result = subprocess .run (
7575 ["pinctrl" , "get" , str (gpioPin )],
0 commit comments