Skip to content

Commit

Permalink
adc_continuous_read
Browse files Browse the repository at this point in the history
  • Loading branch information
pschatzmann committed Oct 20, 2023
1 parent 9cc3139 commit d7c5e41
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/AudioAnalog/AnalogAudioESP32V1.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class AnalogDriverESP32V1 : public AnalogDriverBase {
if(adc_continuous_read(self->adc_handle, dest, samples, &result, self->timeout)== ESP_OK) {
// convert unsigned 8 bits to signed 16 bits;
int16_t* data16 = (int16_t*)dest;
for (int j=samples-1;j>=0;j--){
for (int j = result-1; j>=0; j--){
data16[j] = (static_cast<int16_t>(dest[8]) - 128) * 256;
}
} else {
Expand Down

0 comments on commit d7c5e41

Please sign in to comment.