diff options
author | skullY <skullydazed@gmail.com> | 2019-08-30 11:19:03 -0700 |
---|---|---|
committer | skullydazed <skullydazed@users.noreply.github.com> | 2019-08-30 15:01:52 -0700 |
commit | b624f32f944acdc59dcb130674c09090c5c404cb (patch) | |
tree | bc13adbba137d122d9a2c2fb2fafcbb08ac10e25 /tmk_core/protocol/news.c | |
parent | 61af76a10d00aba185b8338604171de490a13e3b (diff) |
clang-format changes
Diffstat (limited to 'tmk_core/protocol/news.c')
-rw-r--r-- | tmk_core/protocol/news.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/tmk_core/protocol/news.c b/tmk_core/protocol/news.c index 00755a5e2e..4463e8dd42 100644 --- a/tmk_core/protocol/news.c +++ b/tmk_core/protocol/news.c @@ -40,41 +40,34 @@ POSSIBILITY OF SUCH DAMAGE. #include <avr/interrupt.h> #include "news.h" - -void news_init(void) -{ - NEWS_KBD_RX_INIT(); -} +void news_init(void) { NEWS_KBD_RX_INIT(); } // RX ring buffer -#define RBUF_SIZE 8 +#define RBUF_SIZE 8 static uint8_t rbuf[RBUF_SIZE]; static uint8_t rbuf_head = 0; static uint8_t rbuf_tail = 0; -uint8_t news_recv(void) -{ +uint8_t news_recv(void) { uint8_t data = 0; if (rbuf_head == rbuf_tail) { return 0; } - data = rbuf[rbuf_tail]; + data = rbuf[rbuf_tail]; rbuf_tail = (rbuf_tail + 1) % RBUF_SIZE; return data; } // USART RX complete interrupt -ISR(NEWS_KBD_RX_VECT) -{ +ISR(NEWS_KBD_RX_VECT) { uint8_t next = (rbuf_head + 1) % RBUF_SIZE; if (next != rbuf_tail) { rbuf[rbuf_head] = NEWS_KBD_RX_DATA; - rbuf_head = next; + rbuf_head = next; } } - /* SONY NEWS Keyboard Protocol =========================== |