Mercurial > louis > kiibohd-controller
annotate Output/uartOut/output_com.c @ 370:39e338a6733d
Fixing default ErgoDox layout and adding FlashMode button
- Adds proper flashMode support for all keyboards and microcontrollers (usb and serial)
- flashModeEnabled must be set to 1 otherwise it will only show an error
* This is on purpose (somewhat dangerous feature as it allows remote flashing)
- Capability cleanup
author | Jacob Alexander <haata@kiibohd.com> |
---|---|
date | Fri, 21 Aug 2015 19:43:45 -0700 |
parents | ab4515606277 |
children |
rev | line source |
---|---|
275
d5bf41d7f7ef
Initial code for USB cable detection
Jacob Alexander <haata@kiibohd.com>
parents:
263
diff
changeset
|
1 /* Copyright (C) 2014-2015 by Jacob Alexander |
171
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
2 * |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
3 * Permission is hereby granted, free of charge, to any person obtaining a copy |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
4 * of this software and associated documentation files (the "Software"), to deal |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
5 * in the Software without restriction, including without limitation the rights |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
6 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
7 * copies of the Software, and to permit persons to whom the Software is |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
8 * furnished to do so, subject to the following conditions: |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
9 * |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
10 * The above copyright notice and this permission notice shall be included in |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
11 * all copies or substantial portions of the Software. |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
12 * |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
14 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
15 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
16 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
17 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
18 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
19 * THE SOFTWARE. |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
20 */ |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
21 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
22 // ----- Includes ----- |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
23 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
24 // Compiler Includes |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
25 #include <Lib/OutputLib.h> |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
26 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
27 // Project Includes |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
28 #include <cli.h> |
228
398b489276b4
Merging fixes from pjrcUSB
Jacob Alexander <haata@kiibohd.com>
parents:
226
diff
changeset
|
29 #include <led.h> |
171
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
30 #include <print.h> |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
31 #include <scan_loop.h> |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
32 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
33 // USB Includes |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
34 #if defined(_at90usb162_) || defined(_atmega32u4_) || defined(_at90usb646_) || defined(_at90usb1286_) |
263
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
239
diff
changeset
|
35 #elif defined(_mk20dx128_) || defined(_mk20dx128vlf5_) || defined(_mk20dx256_) || defined(_mk20dx256vlh7_) |
171
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
36 #include "arm/uart_serial.h" |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
37 #endif |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
38 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
39 // Local Includes |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
40 #include "output_com.h" |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
41 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
42 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
43 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
44 // ----- Function Declarations ----- |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
45 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
46 void cliFunc_kbdProtocol( char* args ); |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
47 void cliFunc_readLEDs ( char* args ); |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
48 void cliFunc_sendKeys ( char* args ); |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
49 void cliFunc_setKeys ( char* args ); |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
50 void cliFunc_setMod ( char* args ); |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
51 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
52 |
226 | 53 |
171
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
54 // ----- Variables ----- |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
55 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
56 // Output Module command dictionary |
239
2a4c99da1276
HUGE AVR RAM optimization (~28%).
Jacob Alexander <haata@kiibohd.com>
parents:
228
diff
changeset
|
57 CLIDict_Entry( kbdProtocol, "Keyboard Protocol Mode: 0 - Boot, 1 - OS/NKRO Mode" ); |
2a4c99da1276
HUGE AVR RAM optimization (~28%).
Jacob Alexander <haata@kiibohd.com>
parents:
228
diff
changeset
|
58 CLIDict_Entry( readLEDs, "Read LED byte:" NL "\t\t1 NumLck, 2 CapsLck, 4 ScrlLck, 16 Kana, etc." ); |
2a4c99da1276
HUGE AVR RAM optimization (~28%).
Jacob Alexander <haata@kiibohd.com>
parents:
228
diff
changeset
|
59 CLIDict_Entry( sendKeys, "Send the prepared list of USB codes and modifier byte." ); |
2a4c99da1276
HUGE AVR RAM optimization (~28%).
Jacob Alexander <haata@kiibohd.com>
parents:
228
diff
changeset
|
60 CLIDict_Entry( setKeys, "Prepare a space separated list of USB codes (decimal). Waits until \033[35msendKeys\033[0m." ); |
2a4c99da1276
HUGE AVR RAM optimization (~28%).
Jacob Alexander <haata@kiibohd.com>
parents:
228
diff
changeset
|
61 CLIDict_Entry( setMod, "Set the modfier byte:" NL "\t\t1 LCtrl, 2 LShft, 4 LAlt, 8 LGUI, 16 RCtrl, 32 RShft, 64 RAlt, 128 RGUI" ); |
2a4c99da1276
HUGE AVR RAM optimization (~28%).
Jacob Alexander <haata@kiibohd.com>
parents:
228
diff
changeset
|
62 |
2a4c99da1276
HUGE AVR RAM optimization (~28%).
Jacob Alexander <haata@kiibohd.com>
parents:
228
diff
changeset
|
63 CLIDict_Def( outputCLIDict, "USB Module Commands" ) = { |
2a4c99da1276
HUGE AVR RAM optimization (~28%).
Jacob Alexander <haata@kiibohd.com>
parents:
228
diff
changeset
|
64 CLIDict_Item( kbdProtocol ), |
2a4c99da1276
HUGE AVR RAM optimization (~28%).
Jacob Alexander <haata@kiibohd.com>
parents:
228
diff
changeset
|
65 CLIDict_Item( readLEDs ), |
2a4c99da1276
HUGE AVR RAM optimization (~28%).
Jacob Alexander <haata@kiibohd.com>
parents:
228
diff
changeset
|
66 CLIDict_Item( sendKeys ), |
2a4c99da1276
HUGE AVR RAM optimization (~28%).
Jacob Alexander <haata@kiibohd.com>
parents:
228
diff
changeset
|
67 CLIDict_Item( setKeys ), |
2a4c99da1276
HUGE AVR RAM optimization (~28%).
Jacob Alexander <haata@kiibohd.com>
parents:
228
diff
changeset
|
68 CLIDict_Item( setMod ), |
171
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
69 { 0, 0, 0 } // Null entry for dictionary end |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
70 }; |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
71 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
72 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
73 // Which modifier keys are currently pressed |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
74 // 1=left ctrl, 2=left shift, 4=left alt, 8=left gui |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
75 // 16=right ctrl, 32=right shift, 64=right alt, 128=right gui |
308 | 76 uint8_t USBKeys_Modifiers = 0; |
77 uint8_t USBKeys_ModifiersCLI = 0; // Separate CLI send buffer | |
171
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
78 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
79 // Currently pressed keys, max is defined by USB_MAX_KEY_SEND |
308 | 80 uint8_t USBKeys_Keys [USB_NKRO_BITFIELD_SIZE_KEYS]; |
81 uint8_t USBKeys_KeysCLI[USB_NKRO_BITFIELD_SIZE_KEYS]; // Separate CLI send buffer | |
228
398b489276b4
Merging fixes from pjrcUSB
Jacob Alexander <haata@kiibohd.com>
parents:
226
diff
changeset
|
82 |
398b489276b4
Merging fixes from pjrcUSB
Jacob Alexander <haata@kiibohd.com>
parents:
226
diff
changeset
|
83 // System Control and Consumer Control 1KRO containers |
308 | 84 uint8_t USBKeys_SysCtrl; |
85 uint16_t USBKeys_ConsCtrl; | |
171
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
86 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
87 // The number of keys sent to the usb in the array |
308 | 88 uint8_t USBKeys_Sent = 0; |
89 uint8_t USBKeys_SentCLI = 0; | |
171
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
90 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
91 // 1=num lock, 2=caps lock, 4=scroll lock, 8=compose, 16=kana |
228
398b489276b4
Merging fixes from pjrcUSB
Jacob Alexander <haata@kiibohd.com>
parents:
226
diff
changeset
|
92 volatile uint8_t USBKeys_LEDs = 0; |
171
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
93 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
94 // Protocol setting from the host. |
228
398b489276b4
Merging fixes from pjrcUSB
Jacob Alexander <haata@kiibohd.com>
parents:
226
diff
changeset
|
95 // 0 - Boot Mode |
398b489276b4
Merging fixes from pjrcUSB
Jacob Alexander <haata@kiibohd.com>
parents:
226
diff
changeset
|
96 // 1 - NKRO Mode (Default, unless set by a BIOS or boot interface) |
398b489276b4
Merging fixes from pjrcUSB
Jacob Alexander <haata@kiibohd.com>
parents:
226
diff
changeset
|
97 volatile uint8_t USBKeys_Protocol = 0; |
398b489276b4
Merging fixes from pjrcUSB
Jacob Alexander <haata@kiibohd.com>
parents:
226
diff
changeset
|
98 |
398b489276b4
Merging fixes from pjrcUSB
Jacob Alexander <haata@kiibohd.com>
parents:
226
diff
changeset
|
99 // Indicate if USB should send update |
398b489276b4
Merging fixes from pjrcUSB
Jacob Alexander <haata@kiibohd.com>
parents:
226
diff
changeset
|
100 // OS only needs update if there has been a change in state |
398b489276b4
Merging fixes from pjrcUSB
Jacob Alexander <haata@kiibohd.com>
parents:
226
diff
changeset
|
101 USBKeyChangeState USBKeys_Changed = USBKeyChangeState_None; |
171
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
102 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
103 // the idle configuration, how often we send the report to the |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
104 // host (ms * 4) even when it hasn't changed |
308 | 105 uint8_t USBKeys_Idle_Config = 125; |
171
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
106 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
107 // count until idle timeout |
308 | 108 uint8_t USBKeys_Idle_Count = 0; |
171
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
109 |
275
d5bf41d7f7ef
Initial code for USB cable detection
Jacob Alexander <haata@kiibohd.com>
parents:
263
diff
changeset
|
110 // Indicates whether the Output module is fully functional |
d5bf41d7f7ef
Initial code for USB cable detection
Jacob Alexander <haata@kiibohd.com>
parents:
263
diff
changeset
|
111 // 0 - Not fully functional, 1 - Fully functional |
d5bf41d7f7ef
Initial code for USB cable detection
Jacob Alexander <haata@kiibohd.com>
parents:
263
diff
changeset
|
112 // 0 is often used to show that a USB cable is not plugged in (but has power) |
308 | 113 uint8_t Output_Available = 0; |
275
d5bf41d7f7ef
Initial code for USB cable detection
Jacob Alexander <haata@kiibohd.com>
parents:
263
diff
changeset
|
114 |
171
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
115 |
226 | 116 |
117 // ----- Capabilities ----- | |
118 | |
119 // Adds a single USB Code to the USB Output buffer | |
120 // Argument #1: USB Code | |
121 void Output_usbCodeSend_capability( uint8_t state, uint8_t stateType, uint8_t *args ) | |
122 { | |
123 // Display capability name | |
124 if ( stateType == 0xFF && state == 0xFF ) | |
125 { | |
126 print("Output_usbCodeSend(usbCode)"); | |
127 print("Not used in uartOut..."); | |
128 return; | |
129 } | |
130 } | |
131 | |
370
39e338a6733d
Fixing default ErgoDox layout and adding FlashMode button
Jacob Alexander <haata@kiibohd.com>
parents:
308
diff
changeset
|
132 void Output_flashMode_capability( uint8_t state, uint8_t stateType, uint8_t *args ) |
39e338a6733d
Fixing default ErgoDox layout and adding FlashMode button
Jacob Alexander <haata@kiibohd.com>
parents:
308
diff
changeset
|
133 { |
39e338a6733d
Fixing default ErgoDox layout and adding FlashMode button
Jacob Alexander <haata@kiibohd.com>
parents:
308
diff
changeset
|
134 // Display capability name |
39e338a6733d
Fixing default ErgoDox layout and adding FlashMode button
Jacob Alexander <haata@kiibohd.com>
parents:
308
diff
changeset
|
135 if ( stateType == 0xFF && state == 0xFF ) |
39e338a6733d
Fixing default ErgoDox layout and adding FlashMode button
Jacob Alexander <haata@kiibohd.com>
parents:
308
diff
changeset
|
136 { |
39e338a6733d
Fixing default ErgoDox layout and adding FlashMode button
Jacob Alexander <haata@kiibohd.com>
parents:
308
diff
changeset
|
137 print("Output_flashMode(usbCode)"); |
39e338a6733d
Fixing default ErgoDox layout and adding FlashMode button
Jacob Alexander <haata@kiibohd.com>
parents:
308
diff
changeset
|
138 return; |
39e338a6733d
Fixing default ErgoDox layout and adding FlashMode button
Jacob Alexander <haata@kiibohd.com>
parents:
308
diff
changeset
|
139 } |
39e338a6733d
Fixing default ErgoDox layout and adding FlashMode button
Jacob Alexander <haata@kiibohd.com>
parents:
308
diff
changeset
|
140 |
39e338a6733d
Fixing default ErgoDox layout and adding FlashMode button
Jacob Alexander <haata@kiibohd.com>
parents:
308
diff
changeset
|
141 // Start flash mode |
39e338a6733d
Fixing default ErgoDox layout and adding FlashMode button
Jacob Alexander <haata@kiibohd.com>
parents:
308
diff
changeset
|
142 Output_firmwareReload(); |
39e338a6733d
Fixing default ErgoDox layout and adding FlashMode button
Jacob Alexander <haata@kiibohd.com>
parents:
308
diff
changeset
|
143 } |
39e338a6733d
Fixing default ErgoDox layout and adding FlashMode button
Jacob Alexander <haata@kiibohd.com>
parents:
308
diff
changeset
|
144 |
226 | 145 |
146 | |
171
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
147 // ----- Functions ----- |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
148 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
149 // USB Module Setup |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
150 inline void Output_setup() |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
151 { |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
152 // Setup UART |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
153 uart_serial_setup(); |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
154 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
155 // Register USB Output CLI dictionary |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
156 CLI_registerDictionary( outputCLIDict, outputCLIDictName ); |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
157 } |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
158 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
159 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
160 // USB Data Send |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
161 inline void Output_send(void) |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
162 { |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
163 // TODO |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
164 } |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
165 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
166 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
167 // Sets the device into firmware reload mode |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
168 inline void Output_firmwareReload() |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
169 { |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
170 uart_device_reload(); |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
171 } |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
172 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
173 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
174 // USB Input buffer available |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
175 inline unsigned int Output_availablechar() |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
176 { |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
177 return uart_serial_available(); |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
178 } |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
179 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
180 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
181 // USB Get Character from input buffer |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
182 inline int Output_getchar() |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
183 { |
178
555d70c6764d
Removing unnecessary ifdefs
Jacob Alexander <haata@kiibohd.com>
parents:
173
diff
changeset
|
184 // XXX Make sure to check output_availablechar() first! Information is lost with the cast (error codes) (AVR) |
555d70c6764d
Removing unnecessary ifdefs
Jacob Alexander <haata@kiibohd.com>
parents:
173
diff
changeset
|
185 return (int)uart_serial_getchar(); |
171
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
186 } |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
187 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
188 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
189 // USB Send Character to output buffer |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
190 inline int Output_putchar( char c ) |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
191 { |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
192 return uart_serial_putchar( c ); |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
193 } |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
194 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
195 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
196 // USB Send String to output buffer, null terminated |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
197 inline int Output_putstr( char* str ) |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
198 { |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
199 #if defined(_at90usb162_) || defined(_atmega32u4_) || defined(_at90usb646_) || defined(_at90usb1286_) // AVR |
178
555d70c6764d
Removing unnecessary ifdefs
Jacob Alexander <haata@kiibohd.com>
parents:
173
diff
changeset
|
200 uint16_t count = 0; |
263
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
239
diff
changeset
|
201 #elif defined(_mk20dx128_) || defined(_mk20dx128vlf5_) || defined(_mk20dx256_) || defined(_mk20dx256vlh7_) // ARM |
171
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
202 uint32_t count = 0; |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
203 #endif |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
204 // Count characters until NULL character, then send the amount counted |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
205 while ( str[count] != '\0' ) |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
206 count++; |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
207 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
208 return uart_serial_write( str, count ); |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
209 } |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
210 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
211 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
212 // Soft Chip Reset |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
213 inline void Output_softReset() |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
214 { |
226 | 215 #if defined(_at90usb162_) || defined(_atmega32u4_) || defined(_at90usb646_) || defined(_at90usb1286_) // AVR |
263
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
239
diff
changeset
|
216 #elif defined(_mk20dx128_) || defined(_mk20dx128vlf5_) || defined(_mk20dx256_) || defined(_mk20dx256vlh7_) // ARM |
226 | 217 SOFTWARE_RESET(); |
218 #endif | |
171
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
219 } |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
220 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
221 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
222 // ----- CLI Command Functions ----- |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
223 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
224 void cliFunc_kbdProtocol( char* args ) |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
225 { |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
226 print( NL ); |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
227 info_msg("Keyboard Protocol: "); |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
228 printInt8( USBKeys_Protocol ); |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
229 } |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
230 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
231 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
232 void cliFunc_readLEDs( char* args ) |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
233 { |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
234 print( NL ); |
228
398b489276b4
Merging fixes from pjrcUSB
Jacob Alexander <haata@kiibohd.com>
parents:
226
diff
changeset
|
235 info_msg("LED State: "); |
171
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
236 printInt8( USBKeys_LEDs ); |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
237 } |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
238 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
239 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
240 void cliFunc_sendKeys( char* args ) |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
241 { |
228
398b489276b4
Merging fixes from pjrcUSB
Jacob Alexander <haata@kiibohd.com>
parents:
226
diff
changeset
|
242 // Copy USBKeys_KeysCLI to USBKeys_Keys |
171
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
243 for ( uint8_t key = 0; key < USBKeys_SentCLI; ++key ) |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
244 { |
228
398b489276b4
Merging fixes from pjrcUSB
Jacob Alexander <haata@kiibohd.com>
parents:
226
diff
changeset
|
245 // TODO |
398b489276b4
Merging fixes from pjrcUSB
Jacob Alexander <haata@kiibohd.com>
parents:
226
diff
changeset
|
246 //USBKeys_Keys[key] = USBKeys_KeysCLI[key]; |
171
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
247 } |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
248 USBKeys_Sent = USBKeys_SentCLI; |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
249 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
250 // Set modifier byte |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
251 USBKeys_Modifiers = USBKeys_ModifiersCLI; |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
252 } |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
253 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
254 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
255 void cliFunc_setKeys( char* args ) |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
256 { |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
257 char* curArgs; |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
258 char* arg1Ptr; |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
259 char* arg2Ptr = args; |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
260 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
261 // Parse up to USBKeys_MaxSize args (whichever is least) |
228
398b489276b4
Merging fixes from pjrcUSB
Jacob Alexander <haata@kiibohd.com>
parents:
226
diff
changeset
|
262 for ( USBKeys_SentCLI = 0; USBKeys_SentCLI < USB_BOOT_MAX_KEYS; ++USBKeys_SentCLI ) |
171
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
263 { |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
264 curArgs = arg2Ptr; |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
265 CLI_argumentIsolation( curArgs, &arg1Ptr, &arg2Ptr ); |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
266 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
267 // Stop processing args if no more are found |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
268 if ( *arg1Ptr == '\0' ) |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
269 break; |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
270 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
271 // Add the USB code to be sent |
228
398b489276b4
Merging fixes from pjrcUSB
Jacob Alexander <haata@kiibohd.com>
parents:
226
diff
changeset
|
272 // TODO |
398b489276b4
Merging fixes from pjrcUSB
Jacob Alexander <haata@kiibohd.com>
parents:
226
diff
changeset
|
273 //USBKeys_KeysCLI[USBKeys_SentCLI] = numToInt( arg1Ptr ); |
171
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
274 } |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
275 } |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
276 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
277 |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
278 void cliFunc_setMod( char* args ) |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
279 { |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
280 // Parse number from argument |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
281 // NOTE: Only first argument is used |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
282 char* arg1Ptr; |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
283 char* arg2Ptr; |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
284 CLI_argumentIsolation( args, &arg1Ptr, &arg2Ptr ); |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
285 |
195
58cfcb7bac88
Changing decToInt to numToInt (adds support for Hex number interpreter)
Jacob Alexander <haata@kiibohd.com>
parents:
192
diff
changeset
|
286 USBKeys_ModifiersCLI = numToInt( arg1Ptr ); |
171
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
287 } |
aeac00164f2e
Initial code for ARM UART output module (mainly for CLI)
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
288 |