mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
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:
commit
31bf665d88
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user