diff options
author | gornekich <44112859+gornekich@users.noreply.github.com> | 2021-04-24 01:23:16 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-24 01:23:16 +0300 |
commit | 577606afb93fcacd472c169f3cef2e32d9e7040a (patch) | |
tree | 51c3c49e83d57b56b4fab3663a4b1ad8461112cd /applications/ibutton | |
parent | f7aeab7084423a55c0206934d66c05d184143360 (diff) |
[FL-1190] Enable OTG pullup for reading and writing keys (#423)
Diffstat (limited to 'applications/ibutton')
-rw-r--r-- | applications/ibutton/helpers/key-reader.cpp | 2 | ||||
-rw-r--r-- | applications/ibutton/helpers/key-writer.cpp | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/applications/ibutton/helpers/key-reader.cpp b/applications/ibutton/helpers/key-reader.cpp index 0afd5f4b..ed20e227 100644 --- a/applications/ibutton/helpers/key-reader.cpp +++ b/applications/ibutton/helpers/key-reader.cpp @@ -178,10 +178,12 @@ void KeyReader::switch_mode_if_needed() { } void KeyReader::start() { + api_hal_power_enable_otg(); switch_to(ReadMode::CYFRAL_METAKOM); } void KeyReader::stop() { + api_hal_power_disable_otg(); onewire_master->stop(); stop_comaparator(); } diff --git a/applications/ibutton/helpers/key-writer.cpp b/applications/ibutton/helpers/key-writer.cpp index fd587e85..757cd2f8 100644 --- a/applications/ibutton/helpers/key-writer.cpp +++ b/applications/ibutton/helpers/key-writer.cpp @@ -10,10 +10,12 @@ KeyWriter::Error KeyWriter::write(iButtonKey* key) { } void KeyWriter::start() { + api_hal_power_enable_otg(); onewire_master->start(); } void KeyWriter::stop() { + api_hal_power_disable_otg(); onewire_master->stop(); } |