Merge pull request #180 from jhbruhn/patch-1

This commit is contained in:
rbaron 2024-02-14 23:05:36 +01:00 committed by GitHub
commit c7aaf5b388
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -108,6 +108,7 @@ static int read_adc_spec(const struct adc_dt_spec* spec, prst_adc_read_t* out) {
int32_t val_mv = buf; int32_t val_mv = buf;
RET_IF_ERR(adc_raw_to_millivolts_dt(spec, &val_mv)); RET_IF_ERR(adc_raw_to_millivolts_dt(spec, &val_mv));
val_mv = MAX(0, val_mv);
out->raw = buf; out->raw = buf;
out->millivolts = val_mv; out->millivolts = val_mv;