Implement "disable LED driver SDB pin" and "set LED PWM to 0" test actions.
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
#include "led_pwm.h"
|
#include "led_pwm.h"
|
||||||
#include "bridge_protocol.h"
|
#include "bridge_protocol.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
#include "init_peripherials.h"
|
||||||
|
|
||||||
void SetError(uint8_t error);
|
void SetError(uint8_t error);
|
||||||
void SetGenericError();
|
void SetGenericError();
|
||||||
@@ -42,11 +43,17 @@ void BridgeProtocolHandler()
|
|||||||
case BridgeCommand_SetLedPwmBrightness:
|
case BridgeCommand_SetLedPwmBrightness:
|
||||||
BridgeTxSize = 0;
|
BridgeTxSize = 0;
|
||||||
uint8_t brightnessPercent = BridgeRxBuffer[1];
|
uint8_t brightnessPercent = BridgeRxBuffer[1];
|
||||||
|
#if UHK_PCB_MAJOR_VERSION >= 7
|
||||||
LedPwm_SetBrightness(brightnessPercent);
|
LedPwm_SetBrightness(brightnessPercent);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case BridgeCommand_SetDisableKeyMatrixScanState:
|
case BridgeCommand_SetDisableKeyMatrixScanState:
|
||||||
BridgeTxSize = 0;
|
BridgeTxSize = 0;
|
||||||
DisableKeyMatrixScanState = BridgeRxBuffer[1];
|
DisableKeyMatrixScanState = BridgeRxBuffer[1];
|
||||||
break;
|
break;
|
||||||
|
case BridgeCommand_SetDisableLedSdb:
|
||||||
|
BridgeTxSize = 0;
|
||||||
|
GPIO_WritePinOutput(LED_DRIVER_SDB_GPIO, LED_DRIVER_SDB_PIN, BridgeRxBuffer[1] ? 0 : 1);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,6 +51,18 @@ bool BridgeSlaveUhkModuleHandler(uint8_t uhkModuleId)
|
|||||||
txBuffer[0] = BridgeCommand_SetDisableKeyMatrixScanState;
|
txBuffer[0] = BridgeCommand_SetDisableKeyMatrixScanState;
|
||||||
txBuffer[1] = TestStates.disableKeyMatrixScan;
|
txBuffer[1] = TestStates.disableKeyMatrixScan;
|
||||||
I2cAsyncWrite(I2C_ADDRESS_LEFT_KEYBOARD_HALF, txBuffer, 2);
|
I2cAsyncWrite(I2C_ADDRESS_LEFT_KEYBOARD_HALF, txBuffer, 2);
|
||||||
|
currentUhkModuleField = UhkModuleField_SendLedPwmBrightness;
|
||||||
|
break;
|
||||||
|
case UhkModuleField_SendLedPwmBrightness:
|
||||||
|
txBuffer[0] = BridgeCommand_SetDisableKeyMatrixScanState;
|
||||||
|
txBuffer[1] = TestStates.disableKeyMatrixScan;
|
||||||
|
I2cAsyncWrite(I2C_ADDRESS_LEFT_KEYBOARD_HALF, txBuffer, 2);
|
||||||
|
currentUhkModuleField = UhkModuleField_DisableLedSdb;
|
||||||
|
break;
|
||||||
|
case UhkModuleField_DisableLedSdb:
|
||||||
|
txBuffer[0] = BridgeCommand_SetDisableLedSdb;
|
||||||
|
txBuffer[1] = TestStates.disableLedSdb;
|
||||||
|
I2cAsyncWrite(I2C_ADDRESS_LEFT_KEYBOARD_HALF, txBuffer, 2);
|
||||||
currentUhkModuleField = UhkModuleField_SendKeystatesRequestCommand;
|
currentUhkModuleField = UhkModuleField_SendKeystatesRequestCommand;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,8 @@
|
|||||||
UhkModuleField_SendPwmBrightnessCommand,
|
UhkModuleField_SendPwmBrightnessCommand,
|
||||||
UhkModuleField_SendTestLedCommand,
|
UhkModuleField_SendTestLedCommand,
|
||||||
UhkModuleField_SendDisableKeyMatrixScanState,
|
UhkModuleField_SendDisableKeyMatrixScanState,
|
||||||
|
UhkModuleField_SendLedPwmBrightness,
|
||||||
|
UhkModuleField_DisableLedSdb,
|
||||||
} uhk_module_field_t;
|
} uhk_module_field_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
#include "test_states.h"
|
#include "test_states.h"
|
||||||
#include "peripherals/test_led.h"
|
#include "peripherals/test_led.h"
|
||||||
#include "bridge_slaves/bridge_slave_led_driver.h"
|
#include "bridge_slaves/bridge_slave_led_driver.h"
|
||||||
|
#include "bridge_slaves/bridge_slave_uhk_module.h"
|
||||||
|
#include "led_pwm.h"
|
||||||
|
|
||||||
static uint8_t activeLayer = LAYER_ID_BASE;
|
static uint8_t activeLayer = LAYER_ID_BASE;
|
||||||
static uint8_t mouseWheelDivisorCounter = 0;
|
static uint8_t mouseWheelDivisorCounter = 0;
|
||||||
@@ -94,6 +96,14 @@ void processTestAction(key_action_t testAction) {
|
|||||||
case TestAction_DisableLedDriverPwm:
|
case TestAction_DisableLedDriverPwm:
|
||||||
SetLeds(0);
|
SetLeds(0);
|
||||||
break;
|
break;
|
||||||
|
case TestAction_DisableLedFetPwm:
|
||||||
|
LedPwm_SetBrightness(0);
|
||||||
|
UhkModuleStates[0].ledPwmBrightness = 0;
|
||||||
|
break;
|
||||||
|
case TestAction_DisableLedSdb:
|
||||||
|
GPIO_WritePinOutput(LED_DRIVER_SDB_GPIO, LED_DRIVER_SDB_PIN, 0);
|
||||||
|
TestStates.disableLedSdb = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
BridgeCommand_SetTestLed,
|
BridgeCommand_SetTestLed,
|
||||||
BridgeCommand_SetLedPwmBrightness,
|
BridgeCommand_SetLedPwmBrightness,
|
||||||
BridgeCommand_SetDisableKeyMatrixScanState,
|
BridgeCommand_SetDisableKeyMatrixScanState,
|
||||||
|
BridgeCommand_SetDisableLedSdb,
|
||||||
} bridge_command_t;
|
} bridge_command_t;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user