Skip to content

Commit

Permalink
esp32/esp32c6: Set ADC to 12bit by default.
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Leech <andrew@alelec.net>
  • Loading branch information
dmfaria authored and pi-anl committed Jun 20, 2024
1 parent f3e6628 commit 7d49c40
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ports/esp32/adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void madcblock_bits_helper(machine_adc_block_obj_t *self, mp_int_t bits) {
self->width = ADC_WIDTH_BIT_11;
break;
#endif
#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3
#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6
case 12:
self->width = ADC_WIDTH_BIT_12;
break;
Expand Down
4 changes: 2 additions & 2 deletions ports/esp32/machine_adc_block.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
#include "driver/adc.h"

machine_adc_block_obj_t madcblock_obj[] = {
#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3
#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6
{{&machine_adc_block_type}, ADC_UNIT_1, 12, -1, {0}},
{{&machine_adc_block_type}, ADC_UNIT_2, 12, -1, {0}},
#elif CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32C6
#elif CONFIG_IDF_TARGET_ESP32S2
{{&machine_adc_block_type}, ADC_UNIT_1, 13, -1, {0}},
{{&machine_adc_block_type}, ADC_UNIT_2, 13, -1, {0}},
#endif
Expand Down

0 comments on commit 7d49c40

Please sign in to comment.