fn boot_time_calibration(&mut self) -> Result<()> {
        if !Path::new(&self.setting.dsm_param).exists() {
            return Err(Error::MissingDSMParam);
        }

        let mut dsm = DSM::new(
            &self.card.name(),
            self.setting.num_channels(),
            Self::rdc_to_ohm,
            Self::TEMP_UPPER_LIMIT_CELSIUS,
            Self::TEMP_LOWER_LIMIT_CELSIUS,
        );
        dsm.set_temp_converter(TempConverter::new(
            Self::dsm_unit_to_celsius,
            Self::celsius_to_dsm_unit,
        ));

        self.set_volume(VolumeMode::Low)?;
        let calib = match dsm.check_speaker_over_heated_workflow()? {
            SpeakerStatus::Hot(previous_calib) => previous_calib,
            SpeakerStatus::Cold => self
                .do_calibration()?
                .iter()
                .enumerate()
                .map(|(ch, calib_data)| dsm.decide_calibration_value_workflow(ch, *calib_data))
                .collect::<Result<Vec<_>>>()?,
        };
        self.apply_calibration_value(calib)?;
        self.set_volume(VolumeMode::High)?;
        Ok(())
    }
/// Performs max98390d boot time calibration.
///
/// # Errors
///
/// If the amplifier fails to complete the calibration.
Performs max98390d boot time calibration.
Performs max98390d boot time calibration .
fn boot_time_calibration(&mut self) -> Result<()> {
        if !Path::new(&self.setting.dsm_param).exists() {
            return Err(Error::MissingDSMParam);
        }
        let mut dsm = DSM::new(
            &self.card.name(),
            self.setting.num_channels(),
            Self::rdc_to_ohm,
            Self::TEMP_UPPER_LIMIT_CELSIUS,
            Self::TEMP_LOWER_LIMIT_CELSIUS,
        );
        dsm.set_temp_converter(TempConverter::new(
            Self::dsm_unit_to_celsius,
            Self::celsius_to_dsm_unit,
        ));
        self.set_volume(VolumeMode::Low)?;
        let calib = match dsm.check_speaker_over_heated_workflow()? {
            SpeakerStatus::Hot(previous_calib) => previous_calib,
            SpeakerStatus::Cold => self
                .do_calibration()?
                .iter()
                .enumerate()
                .map(|(ch, calib_data)| dsm.decide_calibration_value_workflow(ch, *calib_data))
                .collect::<Result<Vec<_>>>()?,
        };
        self.apply_calibration_value(calib)?;
        self.set_volume(VolumeMode::High)?;
        Ok(())
    }
fn boot_time_calibration ( & mut self ) -> Result < ( ) > { if ! Path :: new ( & self . setting . dsm_param ) . exists ( ) { return Err ( Error :: MissingDSMParam ) ; } let mut dsm = DSM :: new ( & self . card . name ( ) , self . setting . num_channels ( ) , Self :: rdc_to_ohm , Self :: TEMP_UPPER_LIMIT_CELSIUS , Self :: TEMP_LOWER_LIMIT_CELSIUS , ) ; dsm . set_temp_converter ( TempConverter :: new ( Self :: dsm_unit_to_celsius , Self :: celsius_to_dsm_unit , ) ) ; self . set_volume ( VolumeMode :: Low ) ? ; let calib = match dsm . check_speaker_over_heated_workflow ( ) ? { SpeakerStatus :: Hot ( previous_calib ) => previous_calib , SpeakerStatus :: Cold => self . do_calibration ( ) ? . iter ( ) . enumerate ( ) . map ( | ( ch , calib_data ) | dsm . decide_calibration_value_workflow ( ch , * calib_data ) ) . collect :: < Result < Vec < _ > > > ( ) ? , } ; self . apply_calibration_value ( calib ) ? ; self . set_volume ( VolumeMode :: High ) ? ; Ok ( ( ) ) }
Performs max98390d boot time calibration.
Performs max98390d boot time calibration .
&mut self
&mut self
errors
If the amplifier fails to complete the calibration.
If the amplifier fails to complete the calibration .