diff --git a/pitopd/pthub/pthub_spi.py b/pitopd/pthub/pthub_spi.py index d4086149..a8fbe704 100644 --- a/pitopd/pthub/pthub_spi.py +++ b/pitopd/pthub/pthub_spi.py @@ -568,7 +568,6 @@ def communicate(): logger.error("Error transceiving SPI data from pi-topHUB. " + str(e)) logger.info(traceback.format_exc()) raise e - return False def _main_thread_loop(): diff --git a/pitopd/ptpulse/ptpulse.py b/pitopd/ptpulse/ptpulse.py index 1e99a837..e75beedc 100644 --- a/pitopd/ptpulse/ptpulse.py +++ b/pitopd/ptpulse/ptpulse.py @@ -205,11 +205,11 @@ def _initialise_v2_hub_pulse(): if HDMI.set_as_audio_output() is False: logger.warning("Failed to configure HDMI output") - HDMI_reboot = HDMI.set_hdmi_drive_in_boot_config(2) + HDMI.set_hdmi_drive_in_boot_config(2) UART_reboot = _check_and_set_serial_config() I2S_reboot = _check_and_set_I2S_config(False) - return HDMI_reboot or UART_reboot or I2S_reboot + return UART_reboot or I2S_reboot def _initialise_v1_hub_pulse(): diff --git a/pitopd/state.py b/pitopd/state.py index cb47d1f6..33847685 100644 --- a/pitopd/state.py +++ b/pitopd/state.py @@ -23,8 +23,7 @@ def get(section: str, key: str, fallback=None): except Exception: if fallback is None: raise - finally: - return val + return val def set(section: str, key: str, value): diff --git a/pitopd/sys_config.py b/pitopd/sys_config.py index 6696eb40..e7d53bf0 100644 --- a/pitopd/sys_config.py +++ b/pitopd/sys_config.py @@ -582,6 +582,7 @@ def boot_config_correctly_configured( expected_clock_val=None, expected_baud_val=None, expected_enabled_val=None ): + clock_val_okay = True if expected_clock_val is not None: if isinstance(expected_clock_val, int): clock_string = _BootConfig.get_value( @@ -592,9 +593,8 @@ def boot_config_correctly_configured( logger.warning( "Invalid init_uart_clock value to check for in /boot/config.txt - must be an integer" ) - else: - clock_val_okay = True + baud_val_okay = True if expected_baud_val is not None: if isinstance(expected_baud_val, int): baud_string = _BootConfig.get_value( @@ -605,9 +605,8 @@ def boot_config_correctly_configured( logger.warning( "Invalid init_uart_baud value to check for in /boot/config.txt - must be an integer" ) - else: - baud_val_okay = True + enabled_val_okay = True if expected_enabled_val is not None: if expected_enabled_val == 1 or expected_enabled_val == 0: enabled_string = _BootConfig.get_value( @@ -618,8 +617,6 @@ def boot_config_correctly_configured( logger.warning( "Invalid enable_uart value to check for in /boot/config.txt - must be 0 or 1" ) - else: - enabled_val_okay = True return clock_val_okay and baud_val_okay and enabled_val_okay