Skip to content

Commit 0342321

Browse files
authored
Merge pull request #100 from CodethinkLabs/benbrewer/dac-offset-zero
Make 2048 the zero value for DAC/OPAMP offset
2 parents 2a72717 + 8cf335a commit 0342321

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

firmware/src/acq/opamp.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
#include "common/error.h"
2323

2424

25+
#define OPAMP_OFFSET_ZERO 2048
26+
27+
2528
typedef struct bl_acq_opamp_s bl_acq_opamp_t;
2629

2730
#if (BL_REVISION == 1)

firmware/src/acq/source.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ enum bl_error bl_acq_source_configure(enum bl_acq_source source)
205205
bl_acq_source_config_t *config = &src->config;
206206

207207
bool opamp_needed = (config->opamp_gain > 1) ||
208-
(config->opamp_offset != 0);
208+
(config->opamp_offset != OPAMP_OFFSET_ZERO);
209209
if (opamp_needed && (src->opamp == NULL)) {
210210
return BL_ERROR_HARDWARE_CONFLICT;
211211
}

0 commit comments

Comments
 (0)