Commit Graph

699 Commits

Author SHA1 Message Date
László Monda
67e304a787 Extract UsbCommand_GetKeyboardState() into its own file. 2017-11-04 10:30:37 +01:00
László Monda
4de340967c Extract UsbCommand_LaunchEepromTransferLegacy() into its own file. 2017-11-04 10:06:55 +01:00
László Monda
54496ca210 Extract UsbCommand_WriteConfig() 2017-11-04 08:43:27 +01:00
László Monda
232f595b41 Extract UsbCommand_SendKbootCommand() 2017-11-04 08:38:19 +01:00
László Monda
8a255aaf5f Extract UsbCommand_JumpToSlaveBootloader() 2017-11-04 08:32:54 +01:00
László Monda
ad4fe1a18d Extract system properties to usb_command_get_property.c 2017-11-04 02:38:00 +01:00
László Monda
336c2e5368 Extract UsbCommand_ReadConfig() to usb_command_read_config.c. Rename Set{Response,Error}* to SetUsb{Response,Error} 2017-11-04 02:11:49 +01:00
László Monda
c0b41b8e60 Remove the ApplyConfig() prototype because it doesn't exist anymore. 2017-11-04 01:36:55 +01:00
László Monda
457f4802d4 Rename usb_command_t to usb_command_id_t and UsbCommand_* to UsbCommandId_* 2017-11-04 01:35:31 +01:00
László Monda
ae3efce452 Extract the applyConfig USB command into usb_command_apply_config.[ch] 2017-11-04 01:32:03 +01:00
László Monda
330a899625 Make the getAdcValue and getDebugInfo USB commands utilize the first byte of the response to provide status as dictated by the UHK protocol. 2017-11-04 01:02:19 +01:00
László Monda
e7f34dcdc6 Simplify code by utilizing type casing on uint8_t arrays. 2017-11-04 00:30:40 +01:00
László Monda
c2a1a94349 Switch keymap only upon keypress. 2017-11-03 22:39:18 +01:00
László Monda
35b8f0084b Don't put a zero scancode into ActiveUsbBasicKeyboardReport->scancodes[basicScancodeIndex++] 2017-11-03 22:32:10 +01:00
László Monda
0688c1bdfc Rename keymaps.[ch] to keymap.[ch] 2017-11-03 19:01:56 +01:00
László Monda
4072a0ea33 Rename Keymap_Switch() to SwitchKeymap() 2017-11-03 18:59:58 +01:00
László Monda
e169627cde Move updateLayerStates() and getActiveLayer() into the newly created layer.c 2017-11-03 18:53:17 +01:00
László Monda
aeb325a09f Being static variables, lowercamelcase HeldLayers and PressedLayers. 2017-11-03 18:43:26 +01:00
László Monda
0df7879358 Get rid of the unused PreviousToggledLayer. 2017-11-03 18:42:04 +01:00
László Monda
bbbecb8f87 Handle layer toggle actions. 2017-11-03 18:29:17 +01:00
László Monda
05bbd28877 Maintain the states of previous key states. 2017-11-03 13:43:16 +01:00
László Monda
b18cb651ce Leave the active layer active even if another layer switcher key gets pressed while holding it. 2017-11-03 12:49:55 +01:00
László Monda
88fac5c1ff Rename key_matrix_instance.[ch] to right_key_matrix.[ch] 2017-11-03 03:30:14 +01:00
László Monda
fe2e611bb1 Update KeyStates[SlotId_RightKeyboardHalf] within usb_report_updater.c instead of main.c 2017-11-03 03:22:56 +01:00
László Monda
599b78a676 Don't expose UpdateUsbReports() anymore. 2017-11-03 03:20:08 +01:00
László Monda
a0a162ae9e Extend key states to include not only the current state but also the previous state and suppressed state. 2017-11-03 03:17:46 +01:00
László Monda
e0868ac866 Rename CurrentKeyStates to KeyStates and move it to the newly created key_states.[ch] 2017-11-03 02:46:34 +01:00
László Monda
31b7dddef4 Read the new UserConfig.userConfigLength field. 2017-11-02 23:10:22 +01:00
László Monda
ecf7f10b9c Exchange Ctrl and Alt according to the official UHK default keymap. 2017-11-02 22:03:43 +01:00
László Monda
2aaef66d85 Convert LAYER_ID_* macros to LayerId_* enum values. 2017-11-02 21:48:30 +01:00
László Monda
00dfd96d55 Instead of scanning the keyboard matrix from the main loop and utilizing busy loops, try to use a PIT interrupt handler to do the same thing, scanning one row per interrupt call without busy loops.
For some reason, this makes the movement of the mouse pointer very slow and makes it jump from time to time, so I ended up adding INTERRUPT_KEY_SCANNER and disabling the timer interrupt.
Also double bufferred the mouse report just like the others. Unfortunately this does not affect this issue.
2017-11-02 01:11:41 +01:00
László Monda
cf007f81bd Merge branch 'master' into add-device-name 2017-10-28 18:46:46 +02:00
László Monda
569493cbfa Add UsbDebugInfo to aid future debugging via USB. 2017-10-28 17:12:52 +02:00
László Monda
f0a98eebb5 Set the initial keymap abbrivation to FTY (for factory keymap). 2017-10-26 20:32:19 +02:00
László Monda
55e4997ea2 Make the system keyboard descriptor play nicely with OSX. 2017-10-26 18:22:37 +02:00
László Monda
5642ab29a1 Reorder USB interfaces in usb_device_config.h, too. 2017-10-26 01:12:51 +02:00
László Monda
6bdd320ed8 Reorder USB interfaces all across the codebase in the following order: generic HID, basic keyboard, media keyboard, system keyboard, mouse. 2017-10-26 00:52:20 +02:00
László Monda
c77286512c Reset keyboard reports just before changing them by UpdateActiveUsbReports(). This seems to completely solve the repeated media key issue. 2017-10-25 18:31:52 +02:00
László Monda
85b1a65ea7 Implement KbootCommand_Ping and set set left BOOTLOADER_TIMEOUT_MS back to 100 ms. 2017-10-23 21:33:08 +02:00
László Monda
ab807cd0c8 Make sendKbootCommand() accept various command types, not only reset. 2017-10-23 01:19:19 +02:00
László Monda
92ee3b5606 Add KBOOT I2C slave driver, its related USB command, and make the firmware updater script of the left half successfully reset the left half after firmware update. 2017-10-22 02:17:43 +02:00
László Monda
e57d199b40 Move FIXED_BUSPAL_BOOTLOADER to buspal/command.c 2017-10-21 03:53:01 +02:00
László Monda
95faf64b76 Remove the now unused FORCE_BUSPAL macro. 2017-10-21 03:50:07 +02:00
László Monda
89fef3d933 Upon receiving the reset BusPal command, reset the MCU and reenumerate in normal keyboard mode. 2017-10-21 01:29:05 +02:00
László Monda
25f8017879 Get rid of the now obsoleted bootloader_config.h 2017-10-20 00:52:32 +02:00
László Monda
968c6c0416 Call NVIC_SystemReset() instead of custom code. 2017-10-20 00:34:01 +02:00
László Monda
37c90cc4a7 Fix indentation. 2017-10-17 00:30:03 +02:00
László Monda
b3e025f443 Make reenumerate() set Wormhole.timeoutMs based on GenericHidInBuffer+2 2017-10-16 23:26:37 +02:00
László Monda
84b304fe02 Read (and ignore) device name. 2017-10-14 15:54:38 +02:00
László Monda
0b120a3286 Fix generic HID descriptor enumeration error by making UsbGenericHidReportDescriptor extern. 2017-10-13 22:49:09 +02:00