diff options
| author | Damien George <damien@micropython.org> | 2023-10-25 19:13:11 +1100 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2023-11-07 16:44:35 +1100 |
| commit | 03eae48847c61985afece342df971f149c8ffa42 (patch) | |
| tree | 41f4ea5a4c634d7891d9f730ef641760c5cf7d46 /ports/esp32/modmachine.c | |
| parent | 4212799fd8bded69e5cf47faf2ebd675906ac151 (diff) | |
extmod/machine_adc_block: Factor esp32 ADCBlock bindings to common code.
This is a code factoring to have the Python bindings in one location, and
all the ports use those same bindings. At this stage only esp32 implements
this class, so the code for the bindings comes from that port.
The documentation is also updated to reflect the esp32's behaviour of
ADCBlock.connect().
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'ports/esp32/modmachine.c')
| -rw-r--r-- | ports/esp32/modmachine.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ports/esp32/modmachine.c b/ports/esp32/modmachine.c index 1e83935a8..461ddacda 100644 --- a/ports/esp32/modmachine.c +++ b/ports/esp32/modmachine.c @@ -312,7 +312,9 @@ STATIC const mp_rom_map_elem_t machine_module_globals_table[] = { #if MICROPY_PY_MACHINE_ADC { MP_ROM_QSTR(MP_QSTR_ADC), MP_ROM_PTR(&machine_adc_type) }, #endif - { MP_ROM_QSTR(MP_QSTR_ADCBlock), MP_ROM_PTR(&machine_adcblock_type) }, + #if MICROPY_PY_MACHINE_ADC_BLOCK + { MP_ROM_QSTR(MP_QSTR_ADCBlock), MP_ROM_PTR(&machine_adc_block_type) }, + #endif #if MICROPY_PY_MACHINE_DAC { MP_ROM_QSTR(MP_QSTR_DAC), MP_ROM_PTR(&machine_dac_type) }, #endif |
