From b624f32f944acdc59dcb130674c09090c5c404cb Mon Sep 17 00:00:00 2001 From: skullY Date: Fri, 30 Aug 2019 11:19:03 -0700 Subject: clang-format changes --- tmk_core/protocol/ps2_interrupt.c | 112 ++++++++++++++++++-------------------- 1 file changed, 52 insertions(+), 60 deletions(-) (limited to 'tmk_core/protocol/ps2_interrupt.c') diff --git a/tmk_core/protocol/ps2_interrupt.c b/tmk_core/protocol/ps2_interrupt.c index 8114442bac..5afc8a82e4 100644 --- a/tmk_core/protocol/ps2_interrupt.c +++ b/tmk_core/protocol/ps2_interrupt.c @@ -46,26 +46,22 @@ POSSIBILITY OF SUCH DAMAGE. #include "ps2_io.h" #include "print.h" - -#define WAIT(stat, us, err) do { \ - if (!wait_##stat(us)) { \ - ps2_error = err; \ - goto ERROR; \ - } \ -} while (0) - +#define WAIT(stat, us, err) \ + do { \ + if (!wait_##stat(us)) { \ + ps2_error = err; \ + goto ERROR; \ + } \ + } while (0) uint8_t ps2_error = PS2_ERR_NONE; - static inline uint8_t pbuf_dequeue(void); -static inline void pbuf_enqueue(uint8_t data); -static inline bool pbuf_has_data(void); -static inline void pbuf_clear(void); +static inline void pbuf_enqueue(uint8_t data); +static inline bool pbuf_has_data(void); +static inline void pbuf_clear(void); - -void ps2_host_init(void) -{ +void ps2_host_init(void) { idle(); PS2_INT_INIT(); PS2_INT_ON(); @@ -73,26 +69,25 @@ void ps2_host_init(void) //_delay_ms(2500); } -uint8_t ps2_host_send(uint8_t data) -{ +uint8_t ps2_host_send(uint8_t data) { bool parity = true; - ps2_error = PS2_ERR_NONE; + ps2_error = PS2_ERR_NONE; PS2_INT_OFF(); /* terminate a transmission if we have */ inhibit(); - _delay_us(100); // 100us [4]p.13, [5]p.50 + _delay_us(100); // 100us [4]p.13, [5]p.50 /* 'Request to Send' and Start bit */ data_lo(); clock_hi(); - WAIT(clock_lo, 10000, 10); // 10ms [5]p.50 + WAIT(clock_lo, 10000, 10); // 10ms [5]p.50 /* Data bit[2-9] */ for (uint8_t i = 0; i < 8; i++) { _delay_us(15); - if (data&(1<