diff options
author | Uladzimir Pylinski <barthess@yandex.ru> | 2016-10-18 10:35:29 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-18 10:35:29 +0300 |
commit | aeb83bf0db1ce611518fc71e9c182602e39772e5 (patch) | |
tree | 280288957209bfa1cc2f244370a9977bab9381dc /os/hal/src | |
parent | 709addd02d5c885870b9d222c068a02165e70a0a (diff) | |
parent | d3185fa5b3ff5912f9035a006ca51fbc9b19d3e1 (diff) | |
download | ChibiOS-Contrib-aeb83bf0db1ce611518fc71e9c182602e39772e5.tar.gz ChibiOS-Contrib-aeb83bf0db1ce611518fc71e9c182602e39772e5.tar.bz2 ChibiOS-Contrib-aeb83bf0db1ce611518fc71e9c182602e39772e5.zip |
Merge pull request #95 from tixiv/onewire-fix
Set sampling channel PWM output to disabled so the IO pin is free.
Diffstat (limited to 'os/hal/src')
-rw-r--r-- | os/hal/src/hal_onewire.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/os/hal/src/hal_onewire.c b/os/hal/src/hal_onewire.c index 49063a6..85630d9 100644 --- a/os/hal/src/hal_onewire.c +++ b/os/hal/src/hal_onewire.c @@ -251,7 +251,6 @@ static void ow_write_bit_I(onewireDriver *owp, ioline_t bit) { static void ow_reset_cb(PWMDriver *pwmp, onewireDriver *owp) { owp->reg.slave_present = (PAL_LOW == ow_read_bit(owp)); - osalSysLockFromISR(); pwmDisableChannelI(pwmp, owp->config->sample_channel); osalThreadResumeI(&owp->thread, MSG_OK); @@ -661,7 +660,7 @@ bool onewireReset(onewireDriver *owp) { pwmcfg->channels[mch].callback = NULL; pwmcfg->channels[mch].mode = owp->config->pwmmode; pwmcfg->channels[sch].callback = pwm_reset_cb; - pwmcfg->channels[sch].mode = PWM_OUTPUT_ACTIVE_LOW; + pwmcfg->channels[sch].mode = PWM_OUTPUT_DISABLED; ow_bus_active(owp); @@ -714,7 +713,7 @@ void onewireRead(onewireDriver *owp, uint8_t *rxbuf, size_t rxbytes) { pwmcfg->channels[mch].callback = NULL; pwmcfg->channels[mch].mode = owp->config->pwmmode; pwmcfg->channels[sch].callback = pwm_read_bit_cb; - pwmcfg->channels[sch].mode = PWM_OUTPUT_ACTIVE_LOW; + pwmcfg->channels[sch].mode = PWM_OUTPUT_DISABLED; ow_bus_active(owp); osalSysLock(); @@ -848,7 +847,7 @@ size_t onewireSearchRom(onewireDriver *owp, uint8_t *result, pwmcfg->channels[mch].callback = NULL; pwmcfg->channels[mch].mode = owp->config->pwmmode; pwmcfg->channels[sch].callback = pwm_search_rom_cb; - pwmcfg->channels[sch].mode = PWM_OUTPUT_ACTIVE_LOW; + pwmcfg->channels[sch].mode = PWM_OUTPUT_DISABLED; ow_bus_active(owp); osalSysLock(); |