summaryrefslogtreecommitdiff
path: root/platforms/avr/drivers/ps2
diff options
context:
space:
mode:
Diffstat (limited to 'platforms/avr/drivers/ps2')
-rw-r--r--platforms/avr/drivers/ps2/ps2_io.c8
-rw-r--r--platforms/avr/drivers/ps2/ps2_usart.c8
2 files changed, 10 insertions, 6 deletions
diff --git a/platforms/avr/drivers/ps2/ps2_io.c b/platforms/avr/drivers/ps2/ps2_io.c
index 7c826fbf1a..b75a1ab0be 100644
--- a/platforms/avr/drivers/ps2/ps2_io.c
+++ b/platforms/avr/drivers/ps2/ps2_io.c
@@ -23,7 +23,9 @@ void clock_lo(void) {
setPinOutput(PS2_CLOCK_PIN);
}
-void clock_hi(void) { setPinInputHigh(PS2_CLOCK_PIN); }
+void clock_hi(void) {
+ setPinInputHigh(PS2_CLOCK_PIN);
+}
bool clock_in(void) {
setPinInputHigh(PS2_CLOCK_PIN);
@@ -42,7 +44,9 @@ void data_lo(void) {
setPinOutput(PS2_DATA_PIN);
}
-void data_hi(void) { setPinInputHigh(PS2_DATA_PIN); }
+void data_hi(void) {
+ setPinInputHigh(PS2_DATA_PIN);
+}
bool data_in(void) {
setPinInputHigh(PS2_DATA_PIN);
diff --git a/platforms/avr/drivers/ps2/ps2_usart.c b/platforms/avr/drivers/ps2/ps2_usart.c
index 151cfcd68f..39ec930d4a 100644
--- a/platforms/avr/drivers/ps2/ps2_usart.c
+++ b/platforms/avr/drivers/ps2/ps2_usart.c
@@ -76,7 +76,7 @@ static inline bool pbuf_has_data(void);
static inline void pbuf_clear(void);
void ps2_host_init(void) {
- idle(); // without this many USART errors occur when cable is disconnected
+ idle(); // without this many USART errors occur when cable is disconnected
PS2_USART_INIT();
PS2_USART_RX_INT_ON();
// POR(150-2000ms) plus BAT(300-500ms) may take 2.5sec([3]p.20)
@@ -91,12 +91,12 @@ uint8_t ps2_host_send(uint8_t data) {
/* terminate a transmission if we have */
inhibit();
- _delay_us(100); // [4]p.13
+ _delay_us(100); // [4]p.13
/* '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++) {
@@ -165,7 +165,7 @@ uint8_t ps2_host_recv(void) {
ISR(PS2_USART_RX_VECT) {
// TODO: request RESEND when error occurs?
- uint8_t error = PS2_USART_ERROR; // USART error should be read before data
+ uint8_t error = PS2_USART_ERROR; // USART error should be read before data
uint8_t data = PS2_USART_RX_DATA;
if (!error) {
pbuf_enqueue(data);