Merge branch 'bugfix/fix_adc_continuouus_example_pytest_potential_failure' into 'master'

adc: fix adc_continuous example pytest potential failure

See merge request espressif/esp-idf!23424
This commit is contained in:
Armando (Dou Yiwen) 2023-04-25 18:54:46 +08:00
commit 31bf665d88
2 changed files with 2 additions and 2 deletions

View File

@ -120,7 +120,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];
uint32_t chan_num = EXAMPLE_ADC_GET_CHANNEL(p);

View File

@ -13,6 +13,6 @@ from pytest_embedded.dut import Dut
@pytest.mark.esp32h2
@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