Added AVR8 programming session struct

This commit is contained in:
Nav
2022-06-03 15:46:28 +01:00
parent 94b7130dbb
commit 012d987454
3 changed files with 15 additions and 4 deletions

View File

@@ -575,16 +575,16 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit
void Avr8::enableProgrammingMode() {
this->avr8DebugInterface->enableProgrammingMode();
this->programmingModeActive = true;
this->programmingSession = ProgrammingSession();
}
void Avr8::disableProgrammingMode() {
this->avr8DebugInterface->disableProgrammingMode();
this->programmingModeActive = false;
this->programmingSession = std::nullopt;
}
bool Avr8::programmingModeEnabled() {
return this->programmingModeActive;
return this->programmingSession.has_value();
}
void Avr8::loadTargetDescriptionFile() {

View File

@@ -13,6 +13,7 @@
#include "Family.hpp"
#include "TargetParameters.hpp"
#include "PadDescriptor.hpp"
#include "ProgrammingSession.hpp"
#include "src/Targets/TargetRegister.hpp"
#include "TargetDescription/TargetDescriptionFile.hpp"
@@ -145,7 +146,7 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit
std::map<TargetRegisterType, TargetRegisterDescriptors> targetRegisterDescriptorsByType;
std::map<TargetMemoryType, TargetMemoryDescriptor> targetMemoryDescriptorsByType;
bool programmingModeActive = false;
std::optional<ProgrammingSession> programmingSession;
/**
* Resolves the appropriate TDF for the AVR8 target and populates this->targetDescriptionFile.

View File

@@ -0,0 +1,10 @@
#pragma once
namespace Bloom::Targets::Microchip::Avr::Avr8Bit
{
struct ProgrammingSession
{
bool applicationSectionErased = false;
bool bootSectionErased = false;
};
}