diff options
author | skullY <skullydazed@gmail.com> | 2019-08-30 11:19:03 -0700 |
---|---|---|
committer | Florian Didron <fdidron@users.noreply.github.com> | 2019-10-01 10:21:12 +0900 |
commit | 93f6749e06b70ba81e15f8b77e5a18675dacddfe (patch) | |
tree | fcf75ef930800a948e5a3ba015d6759889f2284d /tmk_core/protocol/news.c | |
parent | da34bddba16ba7a8495dc30bfe4542551ba87ed4 (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 =========================== |