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_busywait.c | 60 +++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 31 deletions(-) (limited to 'tmk_core/protocol/ps2_busywait.c') diff --git a/tmk_core/protocol/ps2_busywait.c b/tmk_core/protocol/ps2_busywait.c index a64933219e..983194eea8 100644 --- a/tmk_core/protocol/ps2_busywait.c +++ b/tmk_core/protocol/ps2_busywait.c @@ -45,20 +45,17 @@ POSSIBILITY OF SUCH DAMAGE. #include "ps2_io.h" #include "debug.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; - -void ps2_host_init(void) -{ +void ps2_host_init(void) { clock_init(); data_init(); @@ -68,24 +65,23 @@ void ps2_host_init(void) inhibit(); } -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; /* terminate a transmission if we have */ inhibit(); - wait_us(100); // 100us [4]p.13, [5]p.50 + wait_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 */ for (uint8_t i = 0; i < 8; i++) { wait_us(15); - if (data&(1<