From 747c7d2e382f0100f7dde8cfe82ee57451c1d126 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 11 Sep 2023 20:40:28 +0800 Subject: [PATCH] fix tec voltage computation --- main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index b303732..bbda937 100644 --- a/main.cpp +++ b/main.cpp @@ -86,7 +86,7 @@ static void dsp_thread() { // FIXME: net::write seems unimplemented as of libstdc++ 13 float freq_error = freq_peak_local - freq_setpoint; tec_socket.write_some(net::buffer(std::format(":SOUR2:VOLT {:.3f}\n", - std::min(tec_bias+tec_p*freq_error, 0.0f)))); + std::max(tec_bias+tec_p*freq_error, 0.0f)))); last_tec += 100ms; }