From 49cff8e2a3b333422ebb1655154b136302f3de24 Mon Sep 17 00:00:00 2001 From: linuswck Date: Thu, 25 Jul 2024 17:09:03 +0800 Subject: [PATCH] ld: cfg hardware when pd_mon params changes --- src/laser_diode/laser_diode.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/laser_diode/laser_diode.rs b/src/laser_diode/laser_diode.rs index 456863e..9d1229b 100644 --- a/src/laser_diode/laser_diode.rs +++ b/src/laser_diode/laser_diode.rs @@ -182,10 +182,12 @@ impl LdDrive { pub fn set_pd_responsitivity(&mut self, responsitivity: pd_mon_params::ResponsitivityUnit) { self.settings.pd_mon_params.set(responsitivity); + self.set_ld_power_limit(self.settings.ld_pwr_limit) } pub fn set_pd_dark_current(&mut self, i_dark: ElectricCurrent) { self.settings.pd_mon_params.set_i_dark(i_dark); + self.set_ld_power_limit(self.settings.ld_pwr_limit) } pub fn set_ld_power_limit(&mut self, pwr_limit: Power) {