do that stuff to info::from()

This commit is contained in:
Alex Janka 2022-12-18 17:41:39 +11:00
parent 383fa7dd3e
commit f66491885f
2 changed files with 5 additions and 5 deletions

@ -1 +1 @@
Subproject commit 8b80153b46023dd795a24b3e937845e0fc184240
Subproject commit ebc2b3ab00cdc2e90a0a32303003a668a706167b

View file

@ -177,10 +177,10 @@ fn get_data(modbus: &Modbus) -> (Info, MpptRam, MpptEeprom) {
.expect("couldnt");
let info = Info::from(&data_in);
let mut a = INFO_SCALE.lock().expect("Couldn't lock info");
a.v_scale = info.v_scale;
a.i_scale = info.i_scale;
drop(a);
if let Ok(mut g_info) = INFO_SCALE.lock() {
g_info.v_scale = info.v_scale;
g_info.i_scale = info.i_scale;
};
let ram_data = MpptRam {
v_pu_hi: Raw::from_u16(data_in[OffsetsRam::V_PU_HI]),