diff --git a/src/Targets/Microchip/AVR/AVR8/Avr8.cpp b/src/Targets/Microchip/AVR/AVR8/Avr8.cpp index 1ddde9ed..7640f8f8 100644 --- a/src/Targets/Microchip/AVR/AVR8/Avr8.cpp +++ b/src/Targets/Microchip/AVR/AVR8/Avr8.cpp @@ -65,12 +65,12 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit } } - if (targetConfig.jsonObject.contains("updateDwenFuseBitOnDebugWireFailure")) { - this->updateDwenFuseBitOnDebugWireFailure = targetConfig.jsonObject.value( - "updateDwenFuseBitOnDebugWireFailure" + if (targetConfig.jsonObject.contains("updateDwenFuseBit")) { + this->updateDwenFuseBit = targetConfig.jsonObject.value( + "updateDwenFuseBit" ).toBool(); - if (this->updateDwenFuseBitOnDebugWireFailure + if (this->updateDwenFuseBit && this->avrIspInterface == nullptr && this->physicalInterface == PhysicalInterface::DEBUG_WIRE ) { @@ -138,7 +138,7 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit this->avr8DebugInterface->activate(); } catch (const Exceptions::DebugWirePhysicalInterfaceError& debugWireException) { - if (!this->updateDwenFuseBitOnDebugWireFailure) { + if (!this->updateDwenFuseBit) { throw TargetOperationFailure( "Failed to activate debugWire physical interface - check target connection and DWEN fuse " "bit. Bloom can set the DWEN fuse bit automatically. For instructions on enabling this function," @@ -151,7 +151,7 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit "Failed to activate the debugWire physical interface - attempting to access target via " "the ISP interface, for DWEN fuse bit inspection." ); - this->updateDwenFuseBit(true); + this->writeDwenFuseBit(true); } catch (const Exception& exception) { throw Exception( @@ -704,7 +704,7 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit return this->id.value(); } - void Avr8::updateDwenFuseBit(bool setFuse) { + void Avr8::writeDwenFuseBit(bool setFuse) { if (this->avrIspInterface == nullptr) { throw Exception( "Debug tool or driver does not provide access to an ISP interface - please confirm that the " diff --git a/src/Targets/Microchip/AVR/AVR8/Avr8.hpp b/src/Targets/Microchip/AVR/AVR8/Avr8.hpp index fb236d7d..207ba273 100644 --- a/src/Targets/Microchip/AVR/AVR8/Avr8.hpp +++ b/src/Targets/Microchip/AVR/AVR8/Avr8.hpp @@ -136,7 +136,7 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit std::map targetRegisterDescriptorsByType; std::map targetMemoryDescriptorsByType; - bool updateDwenFuseBitOnDebugWireFailure = false; + bool updateDwenFuseBit = false; /** * Users are required to set their desired physical interface in their Bloom configuration. This would take @@ -187,6 +187,6 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit * @param setFuse * True to set the fuse, false to clear it. */ - void updateDwenFuseBit(bool setFuse); + void writeDwenFuseBit(bool setFuse); }; }