summaryrefslogtreecommitdiff
path: root/drivers/ps2/ps2_interrupt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ps2/ps2_interrupt.c')
-rw-r--r--drivers/ps2/ps2_interrupt.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/ps2/ps2_interrupt.c b/drivers/ps2/ps2_interrupt.c
index 70debd02f7..c49b4f8b75 100644
--- a/drivers/ps2/ps2_interrupt.c
+++ b/drivers/ps2/ps2_interrupt.c
@@ -43,7 +43,7 @@ POSSIBILITY OF SUCH DAMAGE.
#if defined(__AVR__)
# include <avr/interrupt.h>
-#elif defined(PROTOCOL_CHIBIOS) // TODO: or STM32 ?
+#elif defined(PROTOCOL_CHIBIOS) // TODO: or STM32 ?
// chibiOS headers
# include "ch.h"
# include "hal.h"
@@ -71,7 +71,9 @@ static inline void pbuf_clear(void);
#if defined(PROTOCOL_CHIBIOS)
void ps2_interrupt_service_routine(void);
-void palCallback(void *arg) { ps2_interrupt_service_routine(); }
+void palCallback(void *arg) {
+ ps2_interrupt_service_routine();
+}
# define PS2_INT_INIT() \
{ palSetLineMode(PS2_CLOCK_PIN, PAL_MODE_INPUT); } \
@@ -85,7 +87,7 @@ void palCallback(void *arg) { ps2_interrupt_service_routine(); }
# define PS2_INT_OFF() \
{ palDisableLineEvent(PS2_CLOCK_PIN); } \
while (0)
-#endif // PROTOCOL_CHIBIOS
+#endif // PROTOCOL_CHIBIOS
void ps2_host_init(void) {
idle();
@@ -103,12 +105,12 @@ uint8_t ps2_host_send(uint8_t data) {
/* 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[2-9] */
for (uint8_t i = 0; i < 8; i++) {
@@ -244,7 +246,9 @@ RETURN:
}
#if defined(__AVR__)
-ISR(PS2_INT_VECT) { ps2_interrupt_service_routine(); }
+ISR(PS2_INT_VECT) {
+ ps2_interrupt_service_routine();
+}
#endif
/* send LED state to keyboard */