From d82837cb93b8675a6e589548e157f31e41aaa039 Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Fri, 20 Nov 2020 09:24:04 -0700 Subject: Added NVIC definition --- 02-usart/include/common.h | 3 +++ 1 file changed, 3 insertions(+) (limited to '02-usart/include/common.h') diff --git a/02-usart/include/common.h b/02-usart/include/common.h index 2f14e42..653279e 100644 --- a/02-usart/include/common.h +++ b/02-usart/include/common.h @@ -44,4 +44,7 @@ typedef __IO uint32_t bits_t; #define regset(reg, mask, val) \ ((reg) = ((reg) & ~mask) | (val << CTZ(mask))) +#define regget(reg, mask) \ + (((reg) & mask) >> (CTZ(mask))) + #endif /* COMMON_H */ -- cgit