Mercurial > louis > kiibohd-controller
comparison 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 |
comparison
equal
deleted
inserted
replaced
446:f570ab7c861a | 447:56237ba5da6f |
---|---|
60 // However, in most cases everything is updated for each packet push | 60 // However, in most cases everything is updated for each packet push |
61 typedef enum USBMouseChangeState { | 61 typedef enum USBMouseChangeState { |
62 USBMouseChangeState_None = 0x00, | 62 USBMouseChangeState_None = 0x00, |
63 USBMouseChangeState_Buttons = 0x01, | 63 USBMouseChangeState_Buttons = 0x01, |
64 USBMouseChangeState_Relative = 0x02, | 64 USBMouseChangeState_Relative = 0x02, |
65 USBMouseChangeState_All = 0x03, | |
65 } USBMouseChangeState; | 66 } USBMouseChangeState; |
66 | 67 |
67 | 68 |
68 | 69 |
69 // ----- Variables ----- | 70 // ----- Variables ----- |
82 | 83 |
83 extern volatile uint16_t USBMouse_Buttons; // Bitmask for mouse buttons | 84 extern volatile uint16_t USBMouse_Buttons; // Bitmask for mouse buttons |
84 extern volatile uint16_t USBMouse_Relative_x; | 85 extern volatile uint16_t USBMouse_Relative_x; |
85 extern volatile uint16_t USBMouse_Relative_y; | 86 extern volatile uint16_t USBMouse_Relative_y; |
86 | 87 |
87 // Misc variables (XXX Some are only properly utilized using AVR) | 88 // Keeps track of the idle timeout refresh (used on Mac OSX) |
88 extern uint8_t USBKeys_Idle_Config; | 89 extern uint8_t USBKeys_Idle_Config; |
89 extern uint8_t USBKeys_Idle_Count; | 90 extern uint32_t USBKeys_Idle_Expiry; |
91 extern uint8_t USBKeys_Idle_Count; // AVR only | |
90 | 92 |
91 extern USBKeyChangeState USBKeys_Changed; | 93 extern USBKeyChangeState USBKeys_Changed; |
92 extern USBMouseChangeState USBMouse_Changed; | 94 extern USBMouseChangeState USBMouse_Changed; |
93 | 95 |
94 extern volatile uint8_t Output_Available; // 0 - Output module not fully functional, 1 - Output module working | 96 extern volatile uint8_t Output_Available; // 0 - Output module not fully functional, 1 - Output module working |