Skip to content

Commit 369c141

Browse files
committed
fix(MPU): Apply volatiles to the D macros, again
1 parent 8835bdd commit 369c141

1 file changed

Lines changed: 7 additions & 13 deletions

File tree

Inc/HALAL/Models/MPU.hpp

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,13 @@
5353
#define D3_C
5454
#define RAM_CODE
5555
#else
56-
/*
57-
* Use C++ attribute syntax when compiled as C++, otherwise fall back to GCC-style
58-
* `__attribute__` so the header is safe to include from both C and C++ translation
59-
* units (some build units may be plain C and would reject the [[...]] syntax).
60-
*/
61-
#define D1_NC __attribute__((section(".mpu_ram_d1_nc.user")))
62-
#define D2_NC __attribute__((section(".mpu_ram_d2_nc.user")))
63-
#define D3_NC __attribute__((section(".mpu_ram_d3_nc.user")))
64-
#define D1_C __attribute__((section(".ram_d1.user")))
65-
#define D2_C __attribute__((section(".ram_d2.user")))
66-
#define D3_C __attribute__((section(".ram_d3.user")))
67-
68-
// Define for RAM code
56+
57+
#define D1_NC __attribute__((section(".mpu_ram_d1_nc.user"), used)) volatile
58+
#define D2_NC __attribute__((section(".mpu_ram_d2_nc.user"), used)) volatile
59+
#define D3_NC __attribute__((section(".mpu_ram_d3_nc.user"), used)) volatile
60+
#define D1_C __attribute__((section(".ram_d1.user"), used))
61+
#define D2_C __attribute__((section(".ram_d2.user"), used))
62+
#define D3_C __attribute__((section(".ram_d3.user"), used))
6963
#define RAM_CODE __attribute__((section(".ram_code")))
7064
#endif
7165

0 commit comments

Comments
 (0)