Merge branch 'bugfix/fix_adc_continuous_pytest_error' into 'release/v5.0'

ADC: fix adc continuous pytest error that only get first digit

See merge request espressif/esp-idf!28031
This commit is contained in:
morris 2023-12-22 19:20:00 +08:00
commit 2e482b8c80
2 changed files with 2 additions and 2 deletions

View File

@ -126,7 +126,7 @@ void app_main(void)
while (1) {
ret = adc_continuous_read(handle, result, EXAMPLE_READ_LEN, &ret_num, 0);
if (ret == ESP_OK) {
ESP_LOGI("TASK", "ret is %x, ret_num is %"PRIu32, ret, ret_num);
ESP_LOGI("TASK", "ret is %x, ret_num is %"PRIu32" bytes", ret, ret_num);
for (int i = 0; i < ret_num; i += SOC_ADC_DIGI_RESULT_BYTES) {
adc_digi_output_data_t *p = (void*)&result[i];
if (check_valid_data(p)) {

View File

@ -11,6 +11,6 @@ from pytest_embedded.dut import Dut
@pytest.mark.esp32c3
@pytest.mark.adc
def test_adc_continuous(dut: Dut) -> None:
res = dut.expect(r'TASK: ret is 0, ret_num is (\d+)')
res = dut.expect(r'TASK: ret is 0, ret_num is (\d+) bytes')
num = res.group(1).decode('utf8')
assert int(num) == 256