Skip to content

Commit

Permalink
adc: fix legacy oneshot driver clock gating issue on c3
Browse files Browse the repository at this point in the history
  • Loading branch information
Icarus113 committed Mar 7, 2023
1 parent 60b90c5 commit f0af48b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions components/driver/adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,7 @@ int adc1_get_raw(adc1_channel_t channel)
adc_power_acquire();

SAR_ADC1_LOCK_ACQUIRE();
adc_ll_digi_clk_sel(0);

adc_atten_t atten = s_atten1_single[channel];
uint32_t cal_val = adc_get_calibration_offset(ADC_NUM_1, channel, atten);
Expand Down Expand Up @@ -742,6 +743,7 @@ esp_err_t adc2_get_raw(adc2_channel_t channel, adc_bits_width_t width_bit, int *
adc_power_acquire();

SAR_ADC2_LOCK_ACQUIRE();
adc_ll_digi_clk_sel(0);

adc_arbiter_t config = ADC_ARBITER_CONFIG_DEFAULT();
adc_hal_arbiter_config(&config);
Expand Down

0 comments on commit f0af48b

Please sign in to comment.