From 47dbf0967c42893c14a3ef71e164f91890e631c4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 13 Apr 2026 11:25:21 +0000 Subject: [PATCH 1/2] Initial plan From 72750f2feca0ab5701271d5cfca71faccf7a0fe4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 13 Apr 2026 11:26:25 +0000 Subject: [PATCH 2/2] Fix SystemState_Query to atomically load SystemStates[state] instead of state parameter Agent-Logs-Url: https://github.com/nanoframework/nf-interpreter/sessions/0984bdaf-14ad-41c5-9f9e-2cae232dc3a8 Co-authored-by: josesimoes <1881520+josesimoes@users.noreply.github.com> --- src/HAL/nanoHAL_SystemEvents.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HAL/nanoHAL_SystemEvents.c b/src/HAL/nanoHAL_SystemEvents.c index 954541b725..ac8f6d903f 100644 --- a/src/HAL/nanoHAL_SystemEvents.c +++ b/src/HAL/nanoHAL_SystemEvents.c @@ -55,6 +55,6 @@ __nfweak bool SystemState_Query(SYSTEM_STATE_type state) #if defined(__CM0_CMSIS_VERSION) || defined(__CM0PLUS_CMSIS_VERSION) return (SystemStates[state] > 0) ? true : false; #else - return __atomic_load_n(&state, __ATOMIC_RELAXED) ? true : false; + return (__atomic_load_n(&SystemStates[state], __ATOMIC_RELAXED) > 0) ? true : false; #endif }