Skip to content

Commit 54fb3f3

Browse files
committed
Large USB Module cleanup
Many USB fixes, up to near 100% compliance (except Idle timer) - Idle timer is disabled as it behaves oddly on macOS (can be re-enabled with KLL) - With Idle timer enable, 100% compliance achieved (usb30cv) * Chapter 9 Tests (USB 2 devices) * HID Tests Adds vertical and horizontal mouse wheel support (mouseWheelOut capability) = Highlights = Output/USB/arm/usb_desc.c - HID Descriptor cleanup/fixes (6kro and nkro) - RawIO HID descriptor fixes - Added mouse wheel descriptors - Simplified mouse descriptor - Changed SysCtrl+ConsCtrl endpoint to be a non-boot device * Not a keyboard or mouse Output/USB/arm/usb_desc.c - Fixed mouse and joystick descriptor offsets - Added define for the max number of interfaces * Needed for USB request checking Output/USB/arm/usb_dev.c - Added usb_remote_wakeup flag * USB Remote Wakeup can be toggled by the OS (this tracks support) * Not all OSs set this flag, so enable it by default - Added SET_ADDRESS support - Fixed GET_STATUS (device) response to include remote wakeup * Handles self-powered, but not nicely - GET_STATUS (interface) handled but unused - Fixed GET_STATUS (endpoint) to handle IN/OUT correctly - Added DEVICE_REMOTE_WAKEUP support to CLEAR_FEATURE (device) - Fixed CLEAR_FEATURE (endpoint) to handle IN/OUT correctly - Added DEVICE_REMOTE_WAKEUP support to SET_FEATURE (device) - Fixed SET_FEATURE (endpoint) to handle IN/OUT correctly - Added GET_INTERFACE (interface) * Not really used yet, just returns 0 when valid * Only needed for bAlternateSetting - Added skeleton for SYNCH_FRAME * Only necessary for isochronous endpoints - HID GET_PROTOCOL fixed to return same value as SET_PROTOCOL * Required by compliance testing - Support for usb_remote_wakeup flag Output/USB/arm/usb_mouse.c - Removed old/dead code - Added support for mouse wheel (vertical and horizontal) Output/USB/output_usb.c - Added usbAddr cli command for USB device address (unique, set by host) - Cleaned up mouse state variable intialization - Added usbMouseWheel capability * Instead of over-crowding the usbMouse capability Output/USB/output_usb.h - Added USBMouseChangeStates for WheelVert and WheelHori
1 parent 6d2ccc1 commit 54fb3f3

File tree

13 files changed

+449
-342
lines changed

13 files changed

+449
-342
lines changed

Keyboards/Debug/infinity_led.bash

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Keyboard: Infinity 60% with LED backlight support (MD1.1)
4+
#
5+
# These build scripts are just a convenience for configuring your keyboard (less daunting than CMake)
6+
# Jacob Alexander 2016-2018
7+
8+
# Settings
9+
export BuildPathPrepend="Debug/"
10+
export CMakeListsPath="../../.."
11+
12+
# Default to Alphabet
13+
Layout=$(basename $0 | cut -d'.' -f2)
14+
if [ "${Layout}" = "bash" ]; then
15+
Layout=alphabet
16+
fi
17+
18+
cd ..
19+
20+
21+
#################
22+
# Configuration #
23+
#################
24+
25+
# Feel free to change the variables in this section to configure your keyboard
26+
27+
BuildPath="IC60_LED"
28+
29+
# Define Layout Name
30+
LayoutName=${Layout}
31+
32+
## KLL Configuration ##
33+
34+
# Generally shouldn't be changed, this will affect every layer
35+
BaseMap="scancode_map scancode_map.${Layout}"
36+
37+
# This is the default layer of the keyboard
38+
# NOTE: To combine kll files into a single layout, separate them by spaces
39+
# e.g. DefaultMap="mylayout mylayoutmod"
40+
DefaultMap="mouseTest ic60_led/all-leds stdFuncMap"
41+
42+
# This is where you set the additional layers
43+
# NOTE: Indexing starts at 1
44+
# NOTE: Each new layer is another array entry
45+
# e.g. PartialMaps[1]="layer1 layer1mod"
46+
# PartialMaps[2]="layer2"
47+
# PartialMaps[3]="layer3"
48+
PartialMaps[1]="ic60/hhkbpro2"
49+
50+
51+
52+
##########################
53+
# Advanced Configuration #
54+
##########################
55+
56+
# Don't change the variables in this section unless you know what you're doing
57+
# These are useful for completely custom keyboards
58+
# NOTE: Changing any of these variables will require a force build to compile correctly
59+
60+
# Keyboard Module Configuration
61+
ScanModule="Infinity_60_LED"
62+
MacroModule="PixelMap"
63+
OutputModule="USB"
64+
DebugModule="full"
65+
66+
# Microcontroller
67+
Chip="mk20dx128vlf5"
68+
69+
# Compiler Selection
70+
Compiler="gcc"
71+
72+
73+
74+
########################
75+
# Bash Library Include #
76+
########################
77+
78+
# Shouldn't need to touch this section
79+
80+
# Check if the library can be found
81+
if [ ! -f "${BASH_SOURCE%/*}/cmake.bash" ]; then
82+
echo "ERROR: Cannot find 'cmake.bash'"
83+
exit 1
84+
fi
85+
86+
# Load the library
87+
source "${BASH_SOURCE%/*}/cmake.bash"
88+

Output/Interface/output_gen.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (C) 2011-2017 by Jacob Alexander
1+
/* Copyright (C) 2011-2018 by Jacob Alexander
22
*
33
* Permission is hereby granted, free of charge, to any person obtaining a copy
44
* of this software and associated documentation files (the "Software"), to deal
@@ -100,6 +100,8 @@ void Output_usbCodeSend_capability( TriggerMacro *trigger, uint8_t state, uint8_
100100
__attribute__ ((weak, alias("Output_ignored_capability")));
101101
void Output_usbMouse_capability( TriggerMacro *trigger, uint8_t state, uint8_t stateType, uint8_t *args )
102102
__attribute__ ((weak, alias("Output_ignored_capability")));
103+
void Output_usbMouseWheel_capability( TriggerMacro *trigger, uint8_t state, uint8_t stateType, uint8_t *args )
104+
__attribute__ ((weak, alias("Output_ignored_capability")));
103105
#endif
104106

105107
// Jump to bootloader capability

Output/None/capabilities.kll

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ Date = 2017-12-26;
1010

1111

1212
# Capabilties available to the uartOut output module
13-
consCtrlOut => Output_consCtrlSend_capability( consCode : 2 );
14-
noneOut => Output_noneSend_capability();
15-
sysCtrlOut => Output_sysCtrlSend_capability( sysCode : 1 );
16-
usbKeyOut => Output_usbCodeSend_capability( usbCode : 1 );
17-
mouseOut => Output_usbMouse_capability( mouseCode : 2, relative_x : 2, relative_y : 2 );
13+
consCtrlOut => Output_consCtrlSend_capability( consCode : 2 );
14+
noneOut => Output_noneSend_capability();
15+
sysCtrlOut => Output_sysCtrlSend_capability( sysCode : 1 );
16+
usbKeyOut => Output_usbCodeSend_capability( usbCode : 1 );
17+
mouseOut => Output_usbMouse_capability( mouseCode : 2, relative_x : 2, relative_y : 2 );
18+
mouseWheelOut => Output_usbMouseWheel_capability( vertWheel : 1, horiWheel : 1 );
1819

1920
# Configuration capabilities
2021
kbdProtocolBoot => Output_kbdProtocolBoot_capability();

Output/SeggerRTT/capabilities.kll

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ Date = 2018-03-31;
1010

1111

1212
# Capabilties available to the uartOut output module
13-
consCtrlOut => Output_consCtrlSend_capability( consCode : 2 );
14-
noneOut => Output_noneSend_capability();
15-
sysCtrlOut => Output_sysCtrlSend_capability( sysCode : 1 );
16-
usbKeyOut => Output_usbCodeSend_capability( usbCode : 1 );
17-
mouseOut => Output_usbMouse_capability( mouseCode : 2, relative_x : 2, relative_y : 2 );
13+
consCtrlOut => Output_consCtrlSend_capability( consCode : 2 );
14+
noneOut => Output_noneSend_capability();
15+
sysCtrlOut => Output_sysCtrlSend_capability( sysCode : 1 );
16+
usbKeyOut => Output_usbCodeSend_capability( usbCode : 1 );
17+
mouseOut => Output_usbMouse_capability( mouseCode : 2, relative_x : 2, relative_y : 2 );
18+
mouseWheelOut => Output_usbMouseWheel_capability( vertWheel : 1, horiWheel : 1 );
1819

1920
# Configuration capabilities
2021
kbdProtocolBoot => Output_kbdProtocolBoot_capability();

Output/UARTOut/capabilities.kll

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ Date = 2017-12-17;
1010

1111

1212
# Capabilties available to the uartOut output module
13-
consCtrlOut => Output_consCtrlSend_capability( consCode : 2 );
14-
noneOut => Output_noneSend_capability();
15-
sysCtrlOut => Output_sysCtrlSend_capability( sysCode : 1 );
16-
usbKeyOut => Output_usbCodeSend_capability( usbCode : 1 );
17-
mouseOut => Output_usbMouse_capability( mouseCode : 2, relative_x : 2, relative_y : 2 );
13+
consCtrlOut => Output_consCtrlSend_capability( consCode : 2 );
14+
noneOut => Output_noneSend_capability();
15+
sysCtrlOut => Output_sysCtrlSend_capability( sysCode : 1 );
16+
usbKeyOut => Output_usbCodeSend_capability( usbCode : 1 );
17+
mouseOut => Output_usbMouse_capability( mouseCode : 2, relative_x : 2, relative_y : 2 );
18+
mouseWheelOut => Output_usbMouseWheel_capability( vertWheel : 1, horiWheel : 1 );
1819

1920
# Configuration capabilities
2021
kbdProtocolBoot => Output_kbdProtocolBoot_capability();

0 commit comments

Comments
 (0)