This commit is contained in:
Nav
2022-07-16 19:12:45 +01:00
parent 34993f1733
commit c7cd88e198
7 changed files with 17 additions and 15 deletions

View File

@@ -79,7 +79,8 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr
); );
const auto& payload = response.getPayload(); const auto& payload = response.getPayload();
if (response.getStatusCode() != StatusCode::OK if (
response.getStatusCode() != StatusCode::OK
|| payload.size() < 4 || payload.size() < 4
|| static_cast<StatusCode>(payload[3]) != StatusCode::OK || static_cast<StatusCode>(payload[3]) != StatusCode::OK
) { ) {
@@ -97,10 +98,11 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr
); );
const auto& payload = response.getPayload(); const auto& payload = response.getPayload();
if (response.getStatusCode() != StatusCode::OK if (
response.getStatusCode() != StatusCode::OK
|| payload.size() < 4 || payload.size() < 4
|| static_cast<StatusCode>(payload[3]) != StatusCode::OK || static_cast<StatusCode>(payload[3]) != StatusCode::OK
) { ) {
throw TargetOperationFailure( throw TargetOperationFailure(
"Failed to read lock bit byte via ISP - response frame status code/size indicates a failure." "Failed to read lock bit byte via ISP - response frame status code/size indicates a failure."
); );
@@ -129,7 +131,8 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr
const auto& payload = response.getPayload(); const auto& payload = response.getPayload();
if (response.getStatusCode() != StatusCode::OK if (
response.getStatusCode() != StatusCode::OK
|| payload.size() < 4 || payload.size() < 4
|| static_cast<StatusCode>(payload[3]) != StatusCode::OK || static_cast<StatusCode>(payload[3]) != StatusCode::OK
) { ) {

View File

@@ -26,8 +26,5 @@ namespace Bloom::Events
template <class EventType> template <class EventType>
using SharedEventPointer = std::shared_ptr<const EventType>; using SharedEventPointer = std::shared_ptr<const EventType>;
template <class EventType>
using SharedEventPointerNonConst = std::shared_ptr<EventType>;
using SharedGenericEventPointer = SharedEventPointer<Event>; using SharedGenericEventPointer = SharedEventPointer<Event>;
} }

View File

@@ -3,7 +3,7 @@
namespace Bloom namespace Bloom
{ {
void ConditionVariableNotifier::notify() { void ConditionVariableNotifier::notify() {
auto lock = std::unique_lock(this->mutex); const auto lock = std::unique_lock(this->mutex);
this->notified = true; this->notified = true;
this->conditionalVariable.notify_all(); this->conditionalVariable.notify_all();
} }

View File

@@ -19,7 +19,7 @@ namespace Bloom
* @return * @return
*/ */
static QDateTime currentDateTime() { static QDateTime currentDateTime() {
auto lock = std::unique_lock(DateTime::currentDateTimeMutex); const auto lock = std::unique_lock(DateTime::systemClockMutex);
return QDateTime::currentDateTime(); return QDateTime::currentDateTime();
} }
@@ -32,11 +32,11 @@ namespace Bloom
* @return * @return
*/ */
static QString getTimeZoneAbbreviation(const QDateTime& dateTime) { static QString getTimeZoneAbbreviation(const QDateTime& dateTime) {
auto lock = std::unique_lock(DateTime::currentDateTimeMutex); const auto lock = std::unique_lock(DateTime::systemClockMutex);
return dateTime.timeZoneAbbreviation(); return dateTime.timeZoneAbbreviation();
} }
private: private:
static inline std::mutex currentDateTimeMutex; static inline std::mutex systemClockMutex;
}; };
} }

View File

@@ -167,15 +167,17 @@ namespace Bloom::Widgets
} else { } else {
if (this->highlightedAddresses.contains(this->address)) { if (this->highlightedAddresses.contains(this->address)) {
return &(disabledHighlightedBackgroundColor); return &(disabledHighlightedBackgroundColor);
}
} else if ( if (
this->settings.highlightStackMemory this->settings.highlightStackMemory
&& this->currentStackPointer.has_value() && this->currentStackPointer.has_value()
&& this->address > this->currentStackPointer && this->address > this->currentStackPointer
) { ) {
return &(disabledStackMemoryBackgroundColor); return &(disabledStackMemoryBackgroundColor);
}
} else if (this->settings.highlightFocusedMemory && this->focusedMemoryRegion != nullptr) { if (this->settings.highlightFocusedMemory && this->focusedMemoryRegion != nullptr) {
return &(disabledFocusedRegionBackgroundColor); return &(disabledFocusedRegionBackgroundColor);
} }
} }

View File

@@ -801,7 +801,7 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit
* *
* The precautions described above may reduce the likelihood of Bloom bricking the connected target, but there * The precautions described above may reduce the likelihood of Bloom bricking the connected target, but there
* is still a chance that all of the checks pass, and we still brick the device. Now would be a good time to * is still a chance that all of the checks pass, and we still brick the device. Now would be a good time to
* remind the user of liabilities in regards to Bloom and its contributors. * remind the user of liabilities in regard to Bloom and its contributors.
*/ */
Logger::warning( Logger::warning(
"Updating the DWEN fuse bit is a potentially dangerous operation. Bloom is provided \"AS IS\", " "Updating the DWEN fuse bit is a potentially dangerous operation. Bloom is provided \"AS IS\", "

View File

@@ -30,7 +30,7 @@ namespace Bloom::Targets
TargetRegisterType type = TargetRegisterType::OTHER; TargetRegisterType type = TargetRegisterType::OTHER;
TargetMemoryType memoryType = TargetMemoryType::OTHER; TargetMemoryType memoryType = TargetMemoryType::OTHER;
std::optional<std::string> name = ""; std::optional<std::string> name;
std::optional<std::string> groupName; std::optional<std::string> groupName;
std::optional<std::string> description; std::optional<std::string> description;