From 7b080024aff866d6987bd87b4c9e54201fcbc2a8 Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Wed, 18 Nov 2020 23:16:57 -0700 Subject: Add regset masks to gpio.h --- 02-usart/include/common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '02-usart/include/common.h') diff --git a/02-usart/include/common.h b/02-usart/include/common.h index 394dc62..2f14e42 100644 --- a/02-usart/include/common.h +++ b/02-usart/include/common.h @@ -42,6 +42,6 @@ typedef __IO uint32_t bits_t; #define regset(reg, mask, val) \ - (reg = (reg & ~mask) | (val << CTZ(mask))) + ((reg) = ((reg) & ~mask) | (val << CTZ(mask))) #endif /* COMMON_H */ -- cgit