Init UHK modules.
This commit is contained in:
@@ -31,6 +31,7 @@ static void bridgeProtocolCallback(I2C_Type *base, i2c_master_handle_t *handle,
|
|||||||
|
|
||||||
void InitBridgeProtocolScheduler()
|
void InitBridgeProtocolScheduler()
|
||||||
{
|
{
|
||||||
|
InitUhkModules();
|
||||||
SetLeds(0xff);
|
SetLeds(0xff);
|
||||||
I2C_MasterTransferCreateHandle(I2C_MAIN_BUS_BASEADDR, &I2cMasterHandle, bridgeProtocolCallback, NULL);
|
I2C_MasterTransferCreateHandle(I2C_MAIN_BUS_BASEADDR, &I2cMasterHandle, bridgeProtocolCallback, NULL);
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,17 @@ uhk_module_field_t currentUhkModuleField = UhkModuleField_SendKeystatesRequestCo
|
|||||||
uhk_module_state_t uhkModuleExternalStates[UHK_MODULE_MAX_COUNT];
|
uhk_module_state_t uhkModuleExternalStates[UHK_MODULE_MAX_COUNT];
|
||||||
uint8_t txBuffer[2];
|
uint8_t txBuffer[2];
|
||||||
|
|
||||||
bool BridgeSlaveUhkModuleHandler(uint8_t uhkModuleId) {
|
void InitUhkModules()
|
||||||
|
{
|
||||||
|
for (uint8_t moduleId=0; moduleId<UHK_MODULE_MAX_COUNT; moduleId++) {
|
||||||
|
uhk_module_state_t* uhkModuleState = UhkModuleStates + moduleId;
|
||||||
|
uhkModuleState->isTestLedOn = true;
|
||||||
|
uhkModuleState->ledPwmBrightness = 0x64;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool BridgeSlaveUhkModuleHandler(uint8_t uhkModuleId)
|
||||||
|
{
|
||||||
uhk_module_state_t *uhkModuleInternalState = UhkModuleStates + uhkModuleId;
|
uhk_module_state_t *uhkModuleInternalState = UhkModuleStates + uhkModuleId;
|
||||||
uhk_module_state_t *uhkModuleExternalState = uhkModuleExternalStates + uhkModuleId;
|
uhk_module_state_t *uhkModuleExternalState = uhkModuleExternalStates + uhkModuleId;
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
|
|
||||||
// Functions:
|
// Functions:
|
||||||
|
|
||||||
|
extern void InitUhkModules();
|
||||||
extern bool BridgeSlaveUhkModuleHandler(uint8_t uhkModuleId);
|
extern bool BridgeSlaveUhkModuleHandler(uint8_t uhkModuleId);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user