diff --git a/src/Targets/Microchip/AVR/AVR8/Avr8.cpp b/src/Targets/Microchip/AVR/AVR8/Avr8.cpp index 807be90a..1d893b60 100644 --- a/src/Targets/Microchip/AVR/AVR8/Avr8.cpp +++ b/src/Targets/Microchip/AVR/AVR8/Avr8.cpp @@ -927,7 +927,7 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit Logger::info("Current SPIEN fuse bit value confirmed"); - if (static_cast(dwenFuseByte & dwenFuseBitsDescriptor->bitMask) == !enable) { + if (!static_cast(dwenFuseByte & dwenFuseBitsDescriptor->bitMask) == enable) { /* * The DWEN fuse appears to already be set to the desired value. This may be a result of incorrect data * in the TDF, but we're not taking any chances. @@ -961,11 +961,12 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit : static_cast(dwenFuseByte | dwenFuseBitsDescriptor->bitMask) ); - Logger::warning("Programming DWEN fuse bit"); + Logger::warning("Updating DWEN fuse bit"); this->avrIspInterface->programFuse(newFuse); + Logger::debug("Verifying DWEN fuse bit"); if (this->avrIspInterface->readFuse(dwenFuseBitsDescriptor->fuseType).value != newFuse.value) { - throw Exception("Failed to program fuse bit - post-program value check failed"); + throw Exception("Failed to update DWEN fuse bit - post-update verification failed"); } Logger::info("DWEN fuse bit successfully updated");