Merge pull request #100 from Lauszus/dev

Mouse issue and other fixes
This commit is contained in:
László Monda
2018-04-08 21:27:51 +02:00
committed by GitHub
10 changed files with 68 additions and 55 deletions

View File

@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is loosely based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) The format is loosely based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to the [UHK Versioning](VERSIONING.md) conventions. and this project adheres to the [UHK Versioning](VERSIONING.md) conventions.
## [8.1.5] - 2018-04-04
Device Protocol: 4.2.0 | Module Protocol: 4.0.0 | User Config: 4.0.0 | Hardware Config: 1.0.0
- Set key debounce timeout from 30ms to 60ms. This should eliminate key chattering.
- Use the correct scancode for the menu key of the factory keymap.
## [8.1.4] - 2018-03-05 ## [8.1.4] - 2018-03-05
Device Protocol: 4.2.0 | Module Protocol: 4.0.0 | User Config: 4.0.0 | Hardware Config: 1.0.0 Device Protocol: 4.2.0 | Module Protocol: 4.0.0 | User Config: 4.0.0 | Hardware Config: 1.0.0

View File

@@ -196,21 +196,27 @@ SECTIONS
text_end = ORIGIN(m_text) + LENGTH(m_text); text_end = ORIGIN(m_text) + LENGTH(m_text);
ASSERT(__DATA_END <= text_end, "region m_text overflowed with text and data") ASSERT(__DATA_END <= text_end, "region m_text overflowed with text and data")
USB_RAM_GAP = DEFINED(__usb_ram_size__) ? __usb_ram_size__ : 0x800;
/* Uninitialized data section */ /* Uninitialized data section */
.bss : .bss : ALIGN(4)
{ {
/* This is used by the startup in order to initialize the .bss section */ /* This is used by the startup in order to initialize the .bss section */
. = ALIGN(4);
__START_BSS = .; __START_BSS = .;
__bss_start__ = .; __bss_start__ = .;
*(.bss) *(.bss)
*(.bss*) *(.bss*)
. = ALIGN(512);
USB_RAM_START = .;
. += USB_RAM_GAP;
*(COMMON) *(COMMON)
. = ALIGN(4); . = ALIGN(4);
} > m_data
.m_usb_bdt (NOLOAD) :
{
. = ALIGN(512);
*(m_usb_bdt)
} > m_data
.m_usb_global (NOLOAD) :
{
*(m_usb_global)
__bss_end__ = .; __bss_end__ = .;
__END_BSS = .; __END_BSS = .;
} > m_data } > m_data
@@ -239,17 +245,6 @@ SECTIONS
. += STACK_SIZE; . += STACK_SIZE;
} > m_data_2 } > m_data_2
m_usb_bdt USB_RAM_START (NOLOAD) :
{
*(m_usb_bdt)
USB_RAM_BDT_END = .;
}
m_usb_global USB_RAM_BDT_END (NOLOAD) :
{
*(m_usb_global)
}
/* Initializes stack on the end of block */ /* Initializes stack on the end of block */
__StackTop = ORIGIN(m_data_2) + LENGTH(m_data_2); __StackTop = ORIGIN(m_data_2) + LENGTH(m_data_2);
__StackLimit = __StackTop - STACK_SIZE; __StackLimit = __StackTop - STACK_SIZE;

View File

@@ -56,6 +56,7 @@ parser_error_t ParseConfig(config_buffer_t *buffer)
(void)dataModelMinorVersion; (void)dataModelMinorVersion;
(void)dataModelPatchVersion; (void)dataModelPatchVersion;
(void)deviceName; (void)deviceName;
(void)doubleTapSwitchLayerTimeout;
// LED brightness // LED brightness

View File

@@ -9,7 +9,7 @@
// Macros: // Macros:
#define KEY_DEBOUNCER_INTERVAL_MSEC 1 #define KEY_DEBOUNCER_INTERVAL_MSEC 1
#define KEY_DEBOUNCER_TIMEOUT_MSEC 30 #define KEY_DEBOUNCER_TIMEOUT_MSEC 60
// Functions: // Functions:

View File

@@ -381,41 +381,50 @@ void UpdateUsbReports(void)
{ {
UsbReportUpdateCounter++; UsbReportUpdateCounter++;
if (Timer_GetElapsedTime(&lastUsbUpdateTime) > 100) { // Process the key inputs at a constant rate when moving the mouse, so the mouse speed is consistent
UsbBasicKeyboardReportEverSent = false; if (activeMouseStates[SerializedMouseAction_MoveUp] ||
UsbMediaKeyboardReportEverSent = false; activeMouseStates[SerializedMouseAction_MoveDown] ||
UsbSystemKeyboardReportEverSent = false; activeMouseStates[SerializedMouseAction_MoveLeft] ||
UsbMouseReportEverSentEverSent = false; activeMouseStates[SerializedMouseAction_MoveRight]) {
} if (Timer_GetElapsedTime(&lastUsbUpdateTime) < 10)
return;
} else {
if (Timer_GetElapsedTime(&lastUsbUpdateTime) > 100) {
UsbBasicKeyboardReportEverSent = false;
UsbMediaKeyboardReportEverSent = false;
UsbSystemKeyboardReportEverSent = false;
UsbMouseReportEverSentEverSent = false;
}
if (IsUsbBasicKeyboardReportSent) { if (IsUsbBasicKeyboardReportSent) {
UsbBasicKeyboardReportEverSent = true; UsbBasicKeyboardReportEverSent = true;
} }
if (IsUsbMediaKeyboardReportSent) { if (IsUsbMediaKeyboardReportSent) {
UsbMediaKeyboardReportEverSent = true; UsbMediaKeyboardReportEverSent = true;
} }
if (IsUsbSystemKeyboardReportSent) { if (IsUsbSystemKeyboardReportSent) {
UsbSystemKeyboardReportEverSent = true; UsbSystemKeyboardReportEverSent = true;
} }
if (IsUsbMouseReportSent) { if (IsUsbMouseReportSent) {
UsbMouseReportEverSentEverSent = true; UsbMouseReportEverSentEverSent = true;
} }
bool areUsbReportsSent = true; bool areUsbReportsSent = true;
if (UsbBasicKeyboardReportEverSent) { if (UsbBasicKeyboardReportEverSent) {
areUsbReportsSent &= IsUsbBasicKeyboardReportSent; areUsbReportsSent &= IsUsbBasicKeyboardReportSent;
} }
if (UsbMediaKeyboardReportEverSent) { if (UsbMediaKeyboardReportEverSent) {
areUsbReportsSent &= IsUsbMediaKeyboardReportSent; areUsbReportsSent &= IsUsbMediaKeyboardReportSent;
} }
if (UsbSystemKeyboardReportEverSent) { if (UsbSystemKeyboardReportEverSent) {
areUsbReportsSent &= IsUsbSystemKeyboardReportSent; areUsbReportsSent &= IsUsbSystemKeyboardReportSent;
} }
if (UsbMouseReportEverSentEverSent) { if (UsbMouseReportEverSentEverSent) {
areUsbReportsSent &= IsUsbMouseReportSent; areUsbReportsSent &= IsUsbMouseReportSent;
} }
if (!areUsbReportsSent) { if (!areUsbReportsSent) {
return; return;
}
} }
ResetActiveUsbBasicKeyboardReport(); ResetActiveUsbBasicKeyboardReport();

View File

@@ -36,6 +36,7 @@ for (const device of package.devices) {
mkdir('-p', deviceDir); mkdir('-p', deviceDir);
chmod(644, deviceSource); chmod(644, deviceSource);
cp(deviceSource, `${deviceDir}/firmware.hex`); cp(deviceSource, `${deviceDir}/firmware.hex`);
exec(`cd ${usbDir}; git pull origin master; git checkout master`);
exec(`${usbDir}/user-config-json-to-bin.ts ${deviceDir}/config.bin`); exec(`${usbDir}/user-config-json-to-bin.ts ${deviceDir}/config.bin`);
} }

View File

@@ -15,7 +15,7 @@
"commander": "^2.11.0", "commander": "^2.11.0",
"shelljs": "^0.7.8" "shelljs": "^0.7.8"
}, },
"firmwareVersion": "8.1.4", "firmwareVersion": "8.1.5",
"deviceProtocolVersion": "4.2.0", "deviceProtocolVersion": "4.2.0",
"moduleProtocolVersion": "4.0.0", "moduleProtocolVersion": "4.0.0",
"userConfigVersion": "4.0.0", "userConfigVersion": "4.0.0",

View File

@@ -20,7 +20,7 @@
#define FIRMWARE_MAJOR_VERSION 8 #define FIRMWARE_MAJOR_VERSION 8
#define FIRMWARE_MINOR_VERSION 1 #define FIRMWARE_MINOR_VERSION 1
#define FIRMWARE_PATCH_VERSION 4 #define FIRMWARE_PATCH_VERSION 5
#define DEVICE_PROTOCOL_MAJOR_VERSION 4 #define DEVICE_PROTOCOL_MAJOR_VERSION 4
#define DEVICE_PROTOCOL_MINOR_VERSION 2 #define DEVICE_PROTOCOL_MINOR_VERSION 2