diff options
| author | Scott Shawcroft <scott@tannewt.org> | 2018-06-29 13:43:50 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-06-29 13:43:50 -0700 |
| commit | f1248dcdf445b1fa42d9cc2d534eb7d8a7e53b8e (patch) | |
| tree | c48b58907abf04f41c0e629cd6f3db07564f5492 /shared-module | |
| parent | 6908eed7ef5e9002be13322b95b17af8c9bab475 (diff) | |
| parent | 7c9a0e29960948eaad4485481355a84059148df4 (diff) | |
Merge pull request #973 from dhalbert/3.x_onewire_fix
fix OneWire timing and DigitalInOut.switch_to_input()
Diffstat (limited to 'shared-module')
| -rw-r--r-- | shared-module/bitbangio/OneWire.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/shared-module/bitbangio/OneWire.c b/shared-module/bitbangio/OneWire.c index e77bdb3b2..f5f479087 100644 --- a/shared-module/bitbangio/OneWire.c +++ b/shared-module/bitbangio/OneWire.c @@ -49,6 +49,9 @@ void shared_module_bitbangio_onewire_deinit(bitbangio_onewire_obj_t* self) { common_hal_digitalio_digitalinout_deinit(&self->pin); } +// We use common_hal_mcu_delay_us(). It should not be dependent on interrupts +// to do accurate timekeeping, since we disable interrupts during the delays below. + bool shared_module_bitbangio_onewire_reset(bitbangio_onewire_obj_t* self) { common_hal_mcu_disable_interrupts(); common_hal_digitalio_digitalinout_switch_to_output(&self->pin, false, DRIVE_MODE_OPEN_DRAIN); |
