From 109cdf120ea85f46d664e77c44ea2a311fd49ba2 Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Wed, 24 Jan 2018 00:19:51 -0700 Subject: Small changes in styling to separate bits by octets. --- 03-refactor/src/usart.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to '03-refactor/src') diff --git a/03-refactor/src/usart.c b/03-refactor/src/usart.c index a3b0061..fc58467 100644 --- a/03-refactor/src/usart.c +++ b/03-refactor/src/usart.c @@ -41,9 +41,13 @@ void usart_set_enabled(__IO usart_t* usart, usart_enable_t enabled) usart->c1.ue = 0; } else { /* Set the rx enabled. */ - usart->c1.re = !!(enabled & USART_ENABLE_RX); - usart->c1.te = !!(enabled & USART_ENABLE_TX); - usart->c1.ue = 1; + union USART_CR1 tmp = usart->c1; + + tmp.re = !!(enabled & USART_ENABLE_RX); + tmp.te = !!(enabled & USART_ENABLE_TX); + tmp.ue = 1; + + usart->c1 = tmp; } } -- cgit