4 Commits

Author SHA1 Message Date
László Monda
21ae72dd9e Bump version to 8.5.2, update changelog, package.json, versions.h, and Agent. 2018-10-06 21:31:32 +02:00
László Monda
5fe19abe06 Merge branch 'master' into action-cache 2018-10-06 19:44:08 +02:00
Eric Tang
06e34fdcbc Convert the layer cache to an action cache 2018-10-06 10:02:46 -05:00
Eric Tang
cc6666b96d Don't suppress keys upon keymap changes 2018-10-06 10:02:23 -05:00
7 changed files with 13 additions and 15 deletions

View File

@@ -5,6 +5,12 @@ 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.5.2] - 2018-10-06
Device Protocol: 4.5.0 | Module Protocol: 4.0.0 | User Config: 4.1.0 | Hardware Config: 1.0.0
- Don't suppress keys upon keymap change.
## [8.5.1] - 2018-10-04 ## [8.5.1] - 2018-10-04
Device Protocol: 4.5.0 | Module Protocol: 4.0.0 | User Config: 4.1.0 | Hardware Config: 1.0.0 Device Protocol: 4.5.0 | Module Protocol: 4.0.0 | User Config: 4.1.0 | Hardware Config: 1.0.0

View File

@@ -5,7 +5,6 @@
#include "config_parser/parse_keymap.h" #include "config_parser/parse_keymap.h"
#include "config_parser/config_globals.h" #include "config_parser/config_globals.h"
#include "macros.h" #include "macros.h"
#include "usb_report_updater.h"
keymap_reference_t AllKeymaps[MAX_KEYMAP_NUM] = { keymap_reference_t AllKeymaps[MAX_KEYMAP_NUM] = {
{ {
@@ -25,7 +24,6 @@ void SwitchKeymapById(uint8_t index)
ValidatedUserConfigBuffer.offset = AllKeymaps[index].offset; ValidatedUserConfigBuffer.offset = AllKeymaps[index].offset;
ParseKeymap(&ValidatedUserConfigBuffer, index, AllKeymapsCount, AllMacrosCount); ParseKeymap(&ValidatedUserConfigBuffer, index, AllKeymapsCount, AllMacrosCount);
LedDisplay_UpdateText(); LedDisplay_UpdateText();
KeymapChanged = true;
} }
bool SwitchKeymapByAbbreviation(uint8_t length, char *abbrev) bool SwitchKeymapByAbbreviation(uint8_t length, char *abbrev)

View File

@@ -25,8 +25,7 @@ static uint16_t DoubleTapSwitchLayerReleaseTimeout = 200;
static bool activeMouseStates[ACTIVE_MOUSE_STATES_COUNT]; static bool activeMouseStates[ACTIVE_MOUSE_STATES_COUNT];
bool TestUsbStack = false; bool TestUsbStack = false;
bool KeymapChanged = false; static key_action_t actionCache[SLOT_COUNT][MAX_KEY_COUNT_PER_MODULE];
static uint8_t layerCache[SLOT_COUNT][MAX_KEY_COUNT_PER_MODULE];
volatile uint8_t UsbReportUpdateSemaphore = 0; volatile uint8_t UsbReportUpdateSemaphore = 0;
@@ -335,8 +334,6 @@ static void updateActiveUsbReports(void)
if (layerChanged) { if (layerChanged) {
stickyModifiers = 0; stickyModifiers = 0;
} }
bool keymapChangedLastCycle = KeymapChanged;
KeymapChanged = false;
LedDisplay_SetLayer(activeLayer); LedDisplay_SetLayer(activeLayer);
if (TestUsbStack) { if (TestUsbStack) {
@@ -383,16 +380,14 @@ static void updateActiveUsbReports(void)
secondaryRoleState = SecondaryRoleState_Triggered; secondaryRoleState = SecondaryRoleState_Triggered;
keyState->current = false; keyState->current = false;
} else { } else {
layerCache[slotId][keyId] = activeLayer; actionCache[slotId][keyId] = CurrentKeymap[activeLayer][slotId][keyId];
} }
} }
action = &CurrentKeymap[layerCache[slotId][keyId]][slotId][keyId]; action = &actionCache[slotId][keyId];
if (keyState->current) { if (keyState->current) {
if ((KeymapChanged || keymapChangedLastCycle) && keyState->previous) { if (action->type == KeyActionType_Keystroke && action->keystroke.secondaryRole) {
keyState->suppressed = true;
} else if (action->type == KeyActionType_Keystroke && action->keystroke.secondaryRole) {
// Press released secondary role key. // Press released secondary role key.
if (!keyState->previous && secondaryRoleState == SecondaryRoleState_Released) { if (!keyState->previous && secondaryRoleState == SecondaryRoleState_Released) {
secondaryRoleState = SecondaryRoleState_Pressed; secondaryRoleState = SecondaryRoleState_Pressed;

View File

@@ -74,7 +74,6 @@
extern uint32_t UsbReportUpdateCounter; extern uint32_t UsbReportUpdateCounter;
extern volatile uint8_t UsbReportUpdateSemaphore; extern volatile uint8_t UsbReportUpdateSemaphore;
extern bool TestUsbStack; extern bool TestUsbStack;
extern bool KeymapChanged;
// Functions: // Functions:

View File

@@ -15,7 +15,7 @@
"commander": "^2.11.0", "commander": "^2.11.0",
"shelljs": "^0.7.8" "shelljs": "^0.7.8"
}, },
"firmwareVersion": "8.5.1", "firmwareVersion": "8.5.2",
"deviceProtocolVersion": "4.5.0", "deviceProtocolVersion": "4.5.0",
"moduleProtocolVersion": "4.0.0", "moduleProtocolVersion": "4.0.0",
"userConfigVersion": "4.1.0", "userConfigVersion": "4.1.0",

View File

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