From 9a485793f1181ebec2d6a9b928544e257c7d607f Mon Sep 17 00:00:00 2001 From: nHackel Date: Fri, 27 Sep 2024 15:06:00 +0200 Subject: [PATCH] Fix bug with missing rampdown reset in clearing sequence --- src/lib/rp-daq-lib.c | 7 +++++++ src/lib/rp-daq-lib.h | 1 + src/server/control.c | 5 ++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/lib/rp-daq-lib.c b/src/lib/rp-daq-lib.c index ffa18329..c588f7ac 100644 --- a/src/lib/rp-daq-lib.c +++ b/src/lib/rp-daq-lib.c @@ -659,6 +659,13 @@ int getRampDownDAC(int channel, int index) { return (*((int16_t *)(pdm_cfg + 2*(2+4*index))) >> bitpos) & 1; } +int setRampDownDACAll(int8_t value, int channel) { + for(int i=0; i= 2) { return -1; diff --git a/src/lib/rp-daq-lib.h b/src/lib/rp-daq-lib.h index 649a6dcc..691bd70c 100644 --- a/src/lib/rp-daq-lib.h +++ b/src/lib/rp-daq-lib.h @@ -145,6 +145,7 @@ extern int setEnableDACAll(int8_t, int); extern int setEnableDAC(int8_t, int, int); //extern int setResetDAC(int8_t, int); extern int setRampDownDAC(int8_t, int, int); +extern int setRampDownDACAll(int8_t, int); extern int getRampDownDAC(int, int); // Counter trigger diff --git a/src/server/control.c b/src/server/control.c index abca9c2a..05ef096a 100644 --- a/src/server/control.c +++ b/src/server/control.c @@ -97,9 +97,12 @@ void clearSequence() { setPDMAllValuesVolt(0.0, 2); setPDMAllValuesVolt(0.0, 3); - for(int d=0; d<4; d++) { + for(int d=0; d<6; d++) { setEnableDACAll(1,d); } + for(int d=0; d<2; d++) { + setRampDownDACAll(false,d); + } } bool isSequenceConfigurable() {