Browse Source

esp32/adc: Set ADC to 12bit by default on esp32c6.

Signed-off-by: Andrew Leech <andrew@alelec.net>
pull/11869/head
dmfaria 5 months ago
committed by Damien George
parent
commit
5aa115a4bc
  1. 2
      ports/esp32/adc.c
  2. 4
      ports/esp32/machine_adc_block.c

2
ports/esp32/adc.c

@ -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_ESP32C6 || CONFIG_IDF_TARGET_ESP32S3
case 12:
self->width = ADC_WIDTH_BIT_12;
break;

4
ports/esp32/machine_adc_block.c

@ -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_ESP32C6 || CONFIG_IDF_TARGET_ESP32S3
{{&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

Loading…
Cancel
Save