From 430ad479fc864b7beaeeeff219dd6818420f404c Mon Sep 17 00:00:00 2001 From: BlackMark Date: Wed, 5 Aug 2026 22:02:16 +0200 Subject: [PATCH] Fix volatile compound assignments being deprecated in C++20 --- hardware.hpp | 12 ++++++++---- hardware1.hpp | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/hardware.hpp b/hardware.hpp index 4f8b7b8..9b9fb5c 100644 --- a/hardware.hpp +++ b/hardware.hpp @@ -68,9 +68,11 @@ class Hardware { constexpr uint8_t ControlRegC = DataBitsValues.regCVal | ParityVal | StopBitsVal | ModeVal; if constexpr (UseDoubleSpeed) - *getRegPtr() |= (1 << CtrlFlagsA::SPEED_2X); + *getRegPtr() = + *getRegPtr() | (1 << CtrlFlagsA::SPEED_2X); else - *getRegPtr() &= ~(1 << CtrlFlagsA::SPEED_2X); + *getRegPtr() = + *getRegPtr() & ~(1 << CtrlFlagsA::SPEED_2X); *getRegPtr() = ControlRegB; *getRegPtr() = ControlRegC; @@ -130,12 +132,14 @@ class Hardware { static void enableDataRegEmptyInt() FORCE_INLINE { - *getRegPtr() |= (1 << CtrlFlagsB::DATA_REG_EMPTY_INT_ENABLE); + *getRegPtr() = + *getRegPtr() | (1 << CtrlFlagsB::DATA_REG_EMPTY_INT_ENABLE); } static void disableDataRegEmptyInt() FORCE_INLINE { - *getRegPtr() &= ~(1 << CtrlFlagsB::DATA_REG_EMPTY_INT_ENABLE); + *getRegPtr() = + *getRegPtr() & ~(1 << CtrlFlagsB::DATA_REG_EMPTY_INT_ENABLE); } private: diff --git a/hardware1.hpp b/hardware1.hpp index 05d9494..d2759c7 100644 --- a/hardware1.hpp +++ b/hardware1.hpp @@ -158,3 +158,4 @@ void USART1_UDRE_vect() __attribute__((signal)); #endif #undef FORCE_INLINE +