Mercurial > louis > kiibohd-controller
comparison Output/usbMuxUart/output_com.c @ 308:ab4515606277
Fix whitespace
Use a consistent standard - Tabs in front for indenting, spaces after for anything else. This way everything stays nice and lined up while also letting users change there prefered indent level. Most of the new files from Haata where already in this format.
author | Rowan Decker <Smasher816@gmail.com> |
---|---|
date | Sun, 08 Mar 2015 18:40:01 -0700 |
parents | d5bf41d7f7ef |
children | 4f47971c45c2 |
comparison
equal
deleted
inserted
replaced
305:4617ef5e06f1 | 308:ab4515606277 |
---|---|
46 | 46 |
47 // ----- Macros ----- | 47 // ----- Macros ----- |
48 | 48 |
49 // Used to build a bitmap lookup table from a byte addressable array | 49 // Used to build a bitmap lookup table from a byte addressable array |
50 #define byteLookup( byte ) case (( byte ) * ( 8 )): bytePosition = byte; byteShift = 0; break; \ | 50 #define byteLookup( byte ) case (( byte ) * ( 8 )): bytePosition = byte; byteShift = 0; break; \ |
51 case (( byte ) * ( 8 ) + ( 1 )): bytePosition = byte; byteShift = 1; break; \ | 51 case (( byte ) * ( 8 ) + ( 1 )): bytePosition = byte; byteShift = 1; break; \ |
52 case (( byte ) * ( 8 ) + ( 2 )): bytePosition = byte; byteShift = 2; break; \ | 52 case (( byte ) * ( 8 ) + ( 2 )): bytePosition = byte; byteShift = 2; break; \ |
53 case (( byte ) * ( 8 ) + ( 3 )): bytePosition = byte; byteShift = 3; break; \ | 53 case (( byte ) * ( 8 ) + ( 3 )): bytePosition = byte; byteShift = 3; break; \ |
54 case (( byte ) * ( 8 ) + ( 4 )): bytePosition = byte; byteShift = 4; break; \ | 54 case (( byte ) * ( 8 ) + ( 4 )): bytePosition = byte; byteShift = 4; break; \ |
55 case (( byte ) * ( 8 ) + ( 5 )): bytePosition = byte; byteShift = 5; break; \ | 55 case (( byte ) * ( 8 ) + ( 5 )): bytePosition = byte; byteShift = 5; break; \ |
56 case (( byte ) * ( 8 ) + ( 6 )): bytePosition = byte; byteShift = 6; break; \ | 56 case (( byte ) * ( 8 ) + ( 6 )): bytePosition = byte; byteShift = 6; break; \ |
57 case (( byte ) * ( 8 ) + ( 7 )): bytePosition = byte; byteShift = 7; break | 57 case (( byte ) * ( 8 ) + ( 7 )): bytePosition = byte; byteShift = 7; break |
58 | 58 |
59 | 59 |
60 | 60 |
61 // ----- Function Declarations ----- | 61 // ----- Function Declarations ----- |
62 | 62 |
94 | 94 |
95 | 95 |
96 // Which modifier keys are currently pressed | 96 // Which modifier keys are currently pressed |
97 // 1=left ctrl, 2=left shift, 4=left alt, 8=left gui | 97 // 1=left ctrl, 2=left shift, 4=left alt, 8=left gui |
98 // 16=right ctrl, 32=right shift, 64=right alt, 128=right gui | 98 // 16=right ctrl, 32=right shift, 64=right alt, 128=right gui |
99 uint8_t USBKeys_Modifiers = 0; | 99 uint8_t USBKeys_Modifiers = 0; |
100 uint8_t USBKeys_ModifiersCLI = 0; // Separate CLI send buffer | 100 uint8_t USBKeys_ModifiersCLI = 0; // Separate CLI send buffer |
101 | 101 |
102 // Currently pressed keys, max is defined by USB_MAX_KEY_SEND | 102 // Currently pressed keys, max is defined by USB_MAX_KEY_SEND |
103 uint8_t USBKeys_Keys [USB_NKRO_BITFIELD_SIZE_KEYS]; | 103 uint8_t USBKeys_Keys [USB_NKRO_BITFIELD_SIZE_KEYS]; |
104 uint8_t USBKeys_KeysCLI[USB_NKRO_BITFIELD_SIZE_KEYS]; // Separate CLI send buffer | 104 uint8_t USBKeys_KeysCLI[USB_NKRO_BITFIELD_SIZE_KEYS]; // Separate CLI send buffer |
105 | 105 |
106 // System Control and Consumer Control 1KRO containers | 106 // System Control and Consumer Control 1KRO containers |
107 uint8_t USBKeys_SysCtrl; | 107 uint8_t USBKeys_SysCtrl; |
108 uint16_t USBKeys_ConsCtrl; | 108 uint16_t USBKeys_ConsCtrl; |
109 | 109 |
110 // The number of keys sent to the usb in the array | 110 // The number of keys sent to the usb in the array |
111 uint8_t USBKeys_Sent = 0; | 111 uint8_t USBKeys_Sent = 0; |
112 uint8_t USBKeys_SentCLI = 0; | 112 uint8_t USBKeys_SentCLI = 0; |
113 | 113 |
114 // 1=num lock, 2=caps lock, 4=scroll lock, 8=compose, 16=kana | 114 // 1=num lock, 2=caps lock, 4=scroll lock, 8=compose, 16=kana |
115 volatile uint8_t USBKeys_LEDs = 0; | 115 volatile uint8_t USBKeys_LEDs = 0; |
116 | 116 |
117 // Protocol setting from the host. | 117 // Protocol setting from the host. |
123 // OS only needs update if there has been a change in state | 123 // OS only needs update if there has been a change in state |
124 USBKeyChangeState USBKeys_Changed = USBKeyChangeState_None; | 124 USBKeyChangeState USBKeys_Changed = USBKeyChangeState_None; |
125 | 125 |
126 // the idle configuration, how often we send the report to the | 126 // the idle configuration, how often we send the report to the |
127 // host (ms * 4) even when it hasn't changed | 127 // host (ms * 4) even when it hasn't changed |
128 uint8_t USBKeys_Idle_Config = 125; | 128 uint8_t USBKeys_Idle_Config = 125; |
129 | 129 |
130 // count until idle timeout | 130 // count until idle timeout |
131 uint8_t USBKeys_Idle_Count = 0; | 131 uint8_t USBKeys_Idle_Count = 0; |
132 | 132 |
133 // Indicates whether the Output module is fully functional | 133 // Indicates whether the Output module is fully functional |
134 // 0 - Not fully functional, 1 - Fully functional | 134 // 0 - Not fully functional, 1 - Fully functional |
135 // 0 is often used to show that a USB cable is not plugged in (but has power) | 135 // 0 is often used to show that a USB cable is not plugged in (but has power) |
136 uint8_t Output_Available = 0; | 136 uint8_t Output_Available = 0; |
137 | 137 |
138 | 138 |
139 | 139 |
140 // ----- Capabilities ----- | 140 // ----- Capabilities ----- |
141 | 141 |