From 9331c22620fb9a4012a370d717e6362a5ab84ec4 Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 18 Mar 2021 11:48:09 +1100 Subject: XT converter cleanup (#12264) --- tmk_core/protocol/xt_interrupt.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tmk_core/protocol/xt_interrupt.c') diff --git a/tmk_core/protocol/xt_interrupt.c b/tmk_core/protocol/xt_interrupt.c index 51e52243fd..3dd7e6177b 100644 --- a/tmk_core/protocol/xt_interrupt.c +++ b/tmk_core/protocol/xt_interrupt.c @@ -38,7 +38,6 @@ POSSIBILITY OF SUCH DAMAGE. #include #include -#include #include "xt.h" #include "wait.h" #include "debug.h" @@ -60,7 +59,7 @@ void xt_host_init(void) { /* soft reset: pull clock line down for 20ms */ XT_DATA_LO(); XT_CLOCK_LO(); - _delay_ms(20); + wait_ms(20); /* input mode with pullup */ XT_CLOCK_IN(); @@ -123,6 +122,7 @@ ISR(XT_INT_VECT) { static uint8_t pbuf[PBUF_SIZE]; static uint8_t pbuf_head = 0; static uint8_t pbuf_tail = 0; + static inline void pbuf_enqueue(uint8_t data) { uint8_t sreg = SREG; cli(); @@ -135,6 +135,7 @@ static inline void pbuf_enqueue(uint8_t data) { } SREG = sreg; } + static inline uint8_t pbuf_dequeue(void) { uint8_t val = 0; @@ -148,6 +149,7 @@ static inline uint8_t pbuf_dequeue(void) { return val; } + static inline bool pbuf_has_data(void) { uint8_t sreg = SREG; cli(); @@ -155,6 +157,7 @@ static inline bool pbuf_has_data(void) { SREG = sreg; return has_data; } + static inline void pbuf_clear(void) { uint8_t sreg = SREG; cli(); -- cgit v1.2.3