Merge pull request #7865 from CanyonCasa/reset
Reset stuck low detection
This commit is contained in:
commit
ebfde5c3fa
@ -59,8 +59,10 @@ bool common_hal_onewireio_onewire_reset(onewireio_onewire_obj_t *self) {
|
||||
common_hal_mcu_delay_us(70);
|
||||
bool value = common_hal_digitalio_digitalinout_get_value(&self->pin);
|
||||
common_hal_mcu_delay_us(410);
|
||||
// test if bus returned high (idle) and not stuck at low
|
||||
bool idle = common_hal_digitalio_digitalinout_get_value(&self->pin);
|
||||
common_hal_mcu_enable_interrupts();
|
||||
return value;
|
||||
return value || !idle;
|
||||
}
|
||||
|
||||
bool common_hal_onewireio_onewire_read_bit(onewireio_onewire_obj_t *self) {
|
||||
|
Loading…
Reference in New Issue
Block a user