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(); } diff --git a/lib/onewire/one_wire_master.cpp b/lib/onewire/one_wire_master.cpp index e96eeaae..b7b037f1 100644 --- a/lib/onewire/one_wire_master.cpp +++ b/lib/onewire/one_wire_master.cpp @@ -12,12 +12,10 @@ OneWireMaster::~OneWireMaster() { void OneWireMaster::start(void) { gpio_init(gpio, GpioModeOutputOpenDrain); - api_hal_power_enable_otg(); } void OneWireMaster::stop(void) { gpio_init(gpio, GpioModeAnalog); - api_hal_power_disable_otg(); } void OneWireMaster::reset_search() {