diff Output/pjrcUSB/output_com.h @ 447:56237ba5da6f

Adding auto-restart support whenever USB gets into an odd state - Somewhat aggresive, may cause restarts if the keyboard/OS hasn't fully intialized the keyboard - Added GET_IDLE handling and correct usage of SET_IDLE - Initial implementation of idle send, commented out as it causes issues on Mac OSX for sleeping (keyboard has been working without it) - MacOSX seems to have some sort of data corruption on the USB link, not sure why (other OSs have no issues) - Cleaned up some code - Added a longer sleep after the resume sequence to prevent possible issues sending keys too soon (may need to be increased more) Ipad support now seems flaky, though Mac, Windows seems solid. Init sequence on Linux seems slow, even though there are no errors.
author Jacob Alexander <haata@kiibohd.com>
date Fri, 27 May 2016 01:21:57 -0700
parents d3cef419c849
children 45feb80a2ad1
line wrap: on
line diff
--- a/Output/pjrcUSB/output_com.h	Thu May 26 11:13:35 2016 -0700
+++ b/Output/pjrcUSB/output_com.h	Fri May 27 01:21:57 2016 -0700
@@ -62,6 +62,7 @@
 	USBMouseChangeState_None     = 0x00,
 	USBMouseChangeState_Buttons  = 0x01,
 	USBMouseChangeState_Relative = 0x02,
+	USBMouseChangeState_All      = 0x03,
 } USBMouseChangeState;
 
 
@@ -84,9 +85,10 @@
 extern volatile uint16_t USBMouse_Relative_x;
 extern volatile uint16_t USBMouse_Relative_y;
 
-// Misc variables (XXX Some are only properly utilized using AVR)
+// Keeps track of the idle timeout refresh (used on Mac OSX)
 extern          uint8_t  USBKeys_Idle_Config;
-extern          uint8_t  USBKeys_Idle_Count;
+extern          uint32_t USBKeys_Idle_Expiry;
+extern          uint8_t  USBKeys_Idle_Count; // AVR only
 
 extern USBKeyChangeState   USBKeys_Changed;
 extern USBMouseChangeState USBMouse_Changed;