From ffb0bfa0ae591ca72d7c430d8985b01ce5cf449e Mon Sep 17 00:00:00 2001 From: Avimitin Date: Thu, 9 Jan 2025 13:24:13 +0800 Subject: [PATCH] [emurt] add volatile keyword to mmio register Signed-off-by: Avimitin --- tests/emurt/emurt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/emurt/emurt.c b/tests/emurt/emurt.c index ce9539594..9ae15de55 100644 --- a/tests/emurt/emurt.c +++ b/tests/emurt/emurt.c @@ -4,8 +4,8 @@ #define UART_W_REG 0x10000010 #define PERF_REG 0x10000014 -void t1_put_char(char c) { *(uint32_t *)(UART_W_REG) = (uint32_t)c; } -void place_counter(int i) { *(int *)(PERF_REG) = i; } +void t1_put_char(char c) { *(uint8_t volatile *)(UART_W_REG) = (uint8_t)c; } +void place_counter(int i) { *(int volatile *)(PERF_REG) = i; } /////////////////////// // uart