Compare commits
8 Commits
v8.4.3
...
semaphore-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aeaef7b788 | ||
|
|
b4c2204e50 | ||
|
|
4c0546de6c | ||
|
|
bea4c34a51 | ||
|
|
bdc6232780 | ||
|
|
1d2d1c5049 | ||
|
|
67f07abd0d | ||
|
|
4bfcd6e02c |
@@ -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.4.4] - 2018-08-14
|
||||||
|
|
||||||
|
Device Protocol: 4.4.0 | Module Protocol: 4.0.0 | User Config: 4.1.0 | Hardware Config: 1.0.0
|
||||||
|
|
||||||
|
- Don't wake the host if a key is held down through the beginning of sleep.
|
||||||
|
- Ensure that secondary roles are triggered consistently.
|
||||||
|
|
||||||
## [8.4.3] - 2018-08-12
|
## [8.4.3] - 2018-08-12
|
||||||
|
|
||||||
Device Protocol: 4.4.0 | Module Protocol: 4.0.0 | User Config: 4.1.0 | Hardware Config: 1.0.0
|
Device Protocol: 4.4.0 | Module Protocol: 4.0.0 | User Config: 4.1.0 | Hardware Config: 1.0.0
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
#include "led_display.h"
|
#include "led_display.h"
|
||||||
#include "usb_composite_device.h"
|
#include "usb_composite_device.h"
|
||||||
#include "usb_report_updater.h"
|
|
||||||
|
|
||||||
static usb_basic_keyboard_report_t usbBasicKeyboardReports[2];
|
static usb_basic_keyboard_report_t usbBasicKeyboardReports[2];
|
||||||
uint32_t UsbBasicKeyboardActionCounter;
|
uint32_t UsbBasicKeyboardActionCounter;
|
||||||
@@ -45,7 +44,6 @@ usb_status_t UsbBasicKeyboardCallback(class_handle_t handle, uint32_t event, voi
|
|||||||
switch (event) {
|
switch (event) {
|
||||||
// This event is received when the report has been sent
|
// This event is received when the report has been sent
|
||||||
case kUSB_DeviceHidEventSendResponse:
|
case kUSB_DeviceHidEventSendResponse:
|
||||||
UsbReportUpdateSemaphore &= ~(1 << USB_BASIC_KEYBOARD_INTERFACE_INDEX);
|
|
||||||
if (UsbCompositeDevice.attach) {
|
if (UsbCompositeDevice.attach) {
|
||||||
error = kStatus_USB_Success;
|
error = kStatus_USB_Success;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#include "usb_composite_device.h"
|
#include "usb_composite_device.h"
|
||||||
#include "usb_report_updater.h"
|
|
||||||
|
|
||||||
uint32_t UsbMediaKeyboardActionCounter;
|
uint32_t UsbMediaKeyboardActionCounter;
|
||||||
static usb_media_keyboard_report_t usbMediaKeyboardReports[2];
|
static usb_media_keyboard_report_t usbMediaKeyboardReports[2];
|
||||||
@@ -43,7 +42,6 @@ usb_status_t UsbMediaKeyboardCallback(class_handle_t handle, uint32_t event, voi
|
|||||||
switch (event) {
|
switch (event) {
|
||||||
// This event is received when the report has been sent
|
// This event is received when the report has been sent
|
||||||
case kUSB_DeviceHidEventSendResponse:
|
case kUSB_DeviceHidEventSendResponse:
|
||||||
UsbReportUpdateSemaphore &= ~(1 << USB_MEDIA_KEYBOARD_INTERFACE_INDEX);
|
|
||||||
if (UsbCompositeDevice.attach) {
|
if (UsbCompositeDevice.attach) {
|
||||||
error = kStatus_USB_Success;
|
error = kStatus_USB_Success;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#include "usb_composite_device.h"
|
#include "usb_composite_device.h"
|
||||||
#include "usb_report_updater.h"
|
|
||||||
|
|
||||||
uint32_t UsbMouseActionCounter;
|
uint32_t UsbMouseActionCounter;
|
||||||
static usb_mouse_report_t usbMouseReports[2];
|
static usb_mouse_report_t usbMouseReports[2];
|
||||||
@@ -43,7 +42,6 @@ usb_status_t UsbMouseCallback(class_handle_t handle, uint32_t event, void *param
|
|||||||
switch (event) {
|
switch (event) {
|
||||||
// This event is received when the report has been sent
|
// This event is received when the report has been sent
|
||||||
case kUSB_DeviceHidEventSendResponse:
|
case kUSB_DeviceHidEventSendResponse:
|
||||||
UsbReportUpdateSemaphore &= ~(1 << USB_MOUSE_INTERFACE_INDEX);
|
|
||||||
if (UsbCompositeDevice.attach) {
|
if (UsbCompositeDevice.attach) {
|
||||||
error = kStatus_USB_Success;
|
error = kStatus_USB_Success;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#include "usb_composite_device.h"
|
#include "usb_composite_device.h"
|
||||||
#include "usb_report_updater.h"
|
|
||||||
|
|
||||||
uint32_t UsbSystemKeyboardActionCounter;
|
uint32_t UsbSystemKeyboardActionCounter;
|
||||||
static usb_system_keyboard_report_t usbSystemKeyboardReports[2];
|
static usb_system_keyboard_report_t usbSystemKeyboardReports[2];
|
||||||
@@ -43,7 +42,6 @@ usb_status_t UsbSystemKeyboardCallback(class_handle_t handle, uint32_t event, vo
|
|||||||
switch (event) {
|
switch (event) {
|
||||||
// This event is received when the report has been sent
|
// This event is received when the report has been sent
|
||||||
case kUSB_DeviceHidEventSendResponse:
|
case kUSB_DeviceHidEventSendResponse:
|
||||||
UsbReportUpdateSemaphore &= ~(1 << USB_SYSTEM_KEYBOARD_INTERFACE_INDEX);
|
|
||||||
if (UsbCompositeDevice.attach) {
|
if (UsbCompositeDevice.attach) {
|
||||||
error = kStatus_USB_Success;
|
error = kStatus_USB_Success;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,8 +26,6 @@ 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;
|
||||||
|
|
||||||
volatile uint8_t UsbReportUpdateSemaphore = 0;
|
|
||||||
|
|
||||||
mouse_kinetic_state_t MouseMoveState = {
|
mouse_kinetic_state_t MouseMoveState = {
|
||||||
.isScroll = false,
|
.isScroll = false,
|
||||||
.upState = SerializedMouseAction_MoveUp,
|
.upState = SerializedMouseAction_MoveUp,
|
||||||
@@ -372,12 +370,19 @@ static void updateActiveUsbReports(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (keyState->current) {
|
if (keyState->current) {
|
||||||
|
if (SleepModeActive && !keyState->previous) {
|
||||||
|
WakeUpHost();
|
||||||
|
}
|
||||||
key_action_t *baseAction = &CurrentKeymap[LayerId_Base][slotId][keyId];
|
key_action_t *baseAction = &CurrentKeymap[LayerId_Base][slotId][keyId];
|
||||||
if (layerGotReleased && !(baseAction->type == KeyActionType_Keystroke && baseAction->keystroke.scancode == 0 && baseAction->keystroke.modifiers)) {
|
if (layerGotReleased && !(baseAction->type == KeyActionType_Keystroke && baseAction->keystroke.scancode == 0 && baseAction->keystroke.modifiers)) {
|
||||||
keyState->suppressed = true;
|
keyState->suppressed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (action->type == KeyActionType_Keystroke && action->keystroke.secondaryRole) {
|
// Trigger secondary role.
|
||||||
|
if (!keyState->previous && secondaryRoleState == SecondaryRoleState_Pressed) {
|
||||||
|
secondaryRoleState = SecondaryRoleState_Triggered;
|
||||||
|
keyState->current = false;
|
||||||
|
} 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;
|
||||||
@@ -386,15 +391,9 @@ static void updateActiveUsbReports(void)
|
|||||||
secondaryRole = action->keystroke.secondaryRole;
|
secondaryRole = action->keystroke.secondaryRole;
|
||||||
keyState->suppressed = true;
|
keyState->suppressed = true;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// Trigger secondary role.
|
|
||||||
if (!keyState->previous && secondaryRoleState == SecondaryRoleState_Pressed) {
|
|
||||||
secondaryRoleState = SecondaryRoleState_Triggered;
|
|
||||||
keyState->current = false;
|
|
||||||
} else {
|
} else {
|
||||||
applyKeyAction(keyState, action);
|
applyKeyAction(keyState, action);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (keyState->suppressed) {
|
if (keyState->suppressed) {
|
||||||
keyState->suppressed = false;
|
keyState->suppressed = false;
|
||||||
@@ -436,22 +435,6 @@ void UpdateUsbReports(void)
|
|||||||
KeyStates[SlotId_RightKeyboardHalf][keyId].current = RightKeyMatrix.keyStates[keyId];
|
KeyStates[SlotId_RightKeyboardHalf][keyId].current = RightKeyMatrix.keyStates[keyId];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SleepModeActive) {
|
|
||||||
for (uint8_t slotId = 0; slotId < SLOT_COUNT; slotId++) {
|
|
||||||
for (uint8_t keyId = 0; keyId < MAX_KEY_COUNT_PER_MODULE; keyId++) {
|
|
||||||
if (KeyStates[slotId][keyId].current) {
|
|
||||||
WakeUpHost();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (UsbReportUpdateSemaphore) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
UsbReportUpdateCounter++;
|
UsbReportUpdateCounter++;
|
||||||
|
|
||||||
ResetActiveUsbBasicKeyboardReport();
|
ResetActiveUsbBasicKeyboardReport();
|
||||||
@@ -467,32 +450,20 @@ void UpdateUsbReports(void)
|
|||||||
bool HasUsbMouseReportChanged = memcmp(ActiveUsbMouseReport, GetInactiveUsbMouseReport(), sizeof(usb_mouse_report_t)) != 0;
|
bool HasUsbMouseReportChanged = memcmp(ActiveUsbMouseReport, GetInactiveUsbMouseReport(), sizeof(usb_mouse_report_t)) != 0;
|
||||||
|
|
||||||
if (HasUsbBasicKeyboardReportChanged) {
|
if (HasUsbBasicKeyboardReportChanged) {
|
||||||
usb_status_t status = UsbBasicKeyboardAction();
|
UsbBasicKeyboardAction();
|
||||||
if (status == kStatus_USB_Success) {
|
|
||||||
UsbReportUpdateSemaphore |= 1 << USB_BASIC_KEYBOARD_INTERFACE_INDEX;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (HasUsbMediaKeyboardReportChanged) {
|
if (HasUsbMediaKeyboardReportChanged) {
|
||||||
usb_status_t status = UsbMediaKeyboardAction();
|
UsbMediaKeyboardAction();
|
||||||
if (status == kStatus_USB_Success) {
|
|
||||||
UsbReportUpdateSemaphore |= 1 << USB_MEDIA_KEYBOARD_INTERFACE_INDEX;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (HasUsbSystemKeyboardReportChanged) {
|
if (HasUsbSystemKeyboardReportChanged) {
|
||||||
usb_status_t status = UsbSystemKeyboardAction();
|
UsbSystemKeyboardAction();
|
||||||
if (status == kStatus_USB_Success) {
|
|
||||||
UsbReportUpdateSemaphore |= 1 << USB_SYSTEM_KEYBOARD_INTERFACE_INDEX;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send out the mouse position and wheel values continuously if the report is not zeros, but only send the mouse button states when they change.
|
// Send out the mouse position and wheel values continuously if the report is not zeros, but only send the mouse button states when they change.
|
||||||
if (HasUsbMouseReportChanged || ActiveUsbMouseReport->x || ActiveUsbMouseReport->y ||
|
if (HasUsbMouseReportChanged || ActiveUsbMouseReport->x || ActiveUsbMouseReport->y ||
|
||||||
ActiveUsbMouseReport->wheelX || ActiveUsbMouseReport->wheelY) {
|
ActiveUsbMouseReport->wheelX || ActiveUsbMouseReport->wheelY) {
|
||||||
usb_status_t status = UsbMouseAction();
|
UsbMouseAction();
|
||||||
if (status == kStatus_USB_Success) {
|
|
||||||
UsbReportUpdateSemaphore |= 1 << USB_MOUSE_INTERFACE_INDEX;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,7 +70,6 @@
|
|||||||
extern mouse_kinetic_state_t MouseMoveState;
|
extern mouse_kinetic_state_t MouseMoveState;
|
||||||
extern mouse_kinetic_state_t MouseScrollState;
|
extern mouse_kinetic_state_t MouseScrollState;
|
||||||
extern uint32_t UsbReportUpdateCounter;
|
extern uint32_t UsbReportUpdateCounter;
|
||||||
extern volatile uint8_t UsbReportUpdateSemaphore;
|
|
||||||
extern bool TestUsbStack;
|
extern bool TestUsbStack;
|
||||||
|
|
||||||
// Functions:
|
// Functions:
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
"commander": "^2.11.0",
|
"commander": "^2.11.0",
|
||||||
"shelljs": "^0.7.8"
|
"shelljs": "^0.7.8"
|
||||||
},
|
},
|
||||||
"firmwareVersion": "8.4.3",
|
"firmwareVersion": "8.4.4",
|
||||||
"deviceProtocolVersion": "4.4.0",
|
"deviceProtocolVersion": "4.4.0",
|
||||||
"moduleProtocolVersion": "4.0.0",
|
"moduleProtocolVersion": "4.0.0",
|
||||||
"userConfigVersion": "4.1.0",
|
"userConfigVersion": "4.1.0",
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
#define FIRMWARE_MAJOR_VERSION 8
|
#define FIRMWARE_MAJOR_VERSION 8
|
||||||
#define FIRMWARE_MINOR_VERSION 4
|
#define FIRMWARE_MINOR_VERSION 4
|
||||||
#define FIRMWARE_PATCH_VERSION 3
|
#define FIRMWARE_PATCH_VERSION 4
|
||||||
|
|
||||||
#define DEVICE_PROTOCOL_MAJOR_VERSION 4
|
#define DEVICE_PROTOCOL_MAJOR_VERSION 4
|
||||||
#define DEVICE_PROTOCOL_MINOR_VERSION 4
|
#define DEVICE_PROTOCOL_MINOR_VERSION 4
|
||||||
|
|||||||
Reference in New Issue
Block a user