aboutsummaryrefslogtreecommitdiffstats
path: root/tmk_core/protocol/vusb/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core/protocol/vusb/main.c')
-rw-r--r--tmk_core/protocol/vusb/main.c42
1 files changed, 19 insertions, 23 deletions
diff --git a/tmk_core/protocol/vusb/main.c b/tmk_core/protocol/vusb/main.c
index 86c2188c8..f8322d94a 100644
--- a/tmk_core/protocol/vusb/main.c
+++ b/tmk_core/protocol/vusb/main.c
@@ -21,19 +21,16 @@
#include "uart.h"
#include "debug.h"
-
#define UART_BAUD_RATE 115200
-
/* This is from main.c of USBaspLoader */
-static void initForUsbConnectivity(void)
-{
+static void initForUsbConnectivity(void) {
uint8_t i = 0;
usbInit();
/* enforce USB re-enumerate: */
- usbDeviceDisconnect(); /* do this while interrupts are disabled */
- while(--i){ /* fake USB disconnect for > 250 ms */
+ usbDeviceDisconnect(); /* do this while interrupts are disabled */
+ while (--i) { /* fake USB disconnect for > 250 ms */
wdt_reset();
_delay_ms(1);
}
@@ -41,8 +38,7 @@ static void initForUsbConnectivity(void)
sei();
}
-int main(void)
-{
+int main(void) {
bool suspended = false;
#if USB_COUNT_SOF
uint16_t last_timer = timer_read();
@@ -68,26 +64,26 @@ int main(void)
while (1) {
#if USB_COUNT_SOF
if (usbSofCount != 0) {
- suspended = false;
+ suspended = false;
usbSofCount = 0;
- last_timer = timer_read();
+ last_timer = timer_read();
} else {
// Suspend when no SOF in 3ms-10ms(7.1.7.4 Suspending of USB1.1)
if (timer_elapsed(last_timer) > 5) {
suspended = true;
-/*
- uart_putchar('S');
- _delay_ms(1);
- cli();
- set_sleep_mode(SLEEP_MODE_PWR_DOWN);
- sleep_enable();
- sleep_bod_disable();
- sei();
- sleep_cpu();
- sleep_disable();
- _delay_ms(10);
- uart_putchar('W');
-*/
+ /*
+ uart_putchar('S');
+ _delay_ms(1);
+ cli();
+ set_sleep_mode(SLEEP_MODE_PWR_DOWN);
+ sleep_enable();
+ sleep_bod_disable();
+ sei();
+ sleep_cpu();
+ sleep_disable();
+ _delay_ms(10);
+ uart_putchar('W');
+ */
}
}
#endif