update refs.c call sites for new send_sweep_start and send_ph_result signatures

This commit is contained in:
jess 2026-04-03 07:14:02 -07:00
parent b6ff02bdb4
commit 35be164188
1 changed files with 11 additions and 4 deletions

View File

@ -7,6 +7,7 @@
#include <math.h> #include <math.h>
#include "freertos/FreeRTOS.h" #include "freertos/FreeRTOS.h"
#include "freertos/task.h" #include "freertos/task.h"
#include "esp_timer.h"
extern const uint32_t lp_rtia_map[]; extern const uint32_t lp_rtia_map[];
extern const float lp_rtia_ohms[]; extern const float lp_rtia_ohms[];
@ -232,7 +233,8 @@ void refs_collect(RefStore *store, const EISConfig *cfg)
send_ref_frame(REF_MODE_EIS, (uint8_t)r); send_ref_frame(REF_MODE_EIS, (uint8_t)r);
uint32_t n = eis_calc_num_points(&ref_cfg); uint32_t n = eis_calc_num_points(&ref_cfg);
send_sweep_start(n, ref_cfg.freq_start_hz, ref_cfg.freq_stop_hz); uint32_t ts_ms = (uint32_t)(esp_timer_get_time() / 1000);
send_sweep_start(n, ref_cfg.freq_start_hz, ref_cfg.freq_stop_hz, ts_ms, 0);
int got = eis_sweep(store->eis[r].pts, n, send_eis_point); int got = eis_sweep(store->eis[r].pts, n, send_eis_point);
store->eis[r].n_points = (uint32_t)got; store->eis[r].n_points = (uint32_t)got;
@ -270,7 +272,11 @@ void refs_collect(RefStore *store, const EISConfig *cfg)
ph_cfg.temp_c = temp_get(); ph_cfg.temp_c = temp_get();
echem_ph_ocp(&ph_cfg, &store->ph_ref); echem_ph_ocp(&ph_cfg, &store->ph_ref);
store->ph_valid = 1; store->ph_valid = 1;
send_ph_result(store->ph_ref.v_ocp_mv, store->ph_ref.ph, store->ph_ref.temp_c); {
uint32_t ts_ms = (uint32_t)(esp_timer_get_time() / 1000);
send_ph_result(store->ph_ref.v_ocp_mv, store->ph_ref.ph, store->ph_ref.temp_c,
ts_ms, 0);
}
store->has_refs = 1; store->has_refs = 1;
send_refs_done(); send_refs_done();
@ -291,7 +297,7 @@ void refs_send(const RefStore *store)
send_ref_frame(REF_MODE_EIS, (uint8_t)r); send_ref_frame(REF_MODE_EIS, (uint8_t)r);
uint32_t n = store->eis[r].n_points; uint32_t n = store->eis[r].n_points;
send_sweep_start(n, store->eis[r].pts[0].freq_hz, send_sweep_start(n, store->eis[r].pts[0].freq_hz,
store->eis[r].pts[n - 1].freq_hz); store->eis[r].pts[n - 1].freq_hz, 0, 0);
for (uint32_t i = 0; i < n; i++) for (uint32_t i = 0; i < n; i++)
send_eis_point((uint16_t)i, &store->eis[r].pts[i]); send_eis_point((uint16_t)i, &store->eis[r].pts[i]);
send_sweep_end(); send_sweep_end();
@ -306,7 +312,8 @@ void refs_send(const RefStore *store)
if (store->ph_valid) { if (store->ph_valid) {
send_ref_frame(REF_MODE_PH, 0); send_ref_frame(REF_MODE_PH, 0);
send_ph_result(store->ph_ref.v_ocp_mv, store->ph_ref.ph, store->ph_ref.temp_c); send_ph_result(store->ph_ref.v_ocp_mv, store->ph_ref.ph, store->ph_ref.temp_c,
0, 0);
} }
send_refs_done(); send_refs_done();