Add KBOOT I2C slave driver, its related USB command, and make the firmware updater script of the left half successfully reset the left half after firmware update.

This commit is contained in:
László Monda
2017-10-22 02:17:43 +02:00
parent e57d199b40
commit 92ee3b5606
7 changed files with 103 additions and 1 deletions

View File

@@ -9,12 +9,14 @@
#include "led_pwm.h"
#include "slave_scheduler.h"
#include "slave_drivers/uhk_module_driver.h"
#include "slave_drivers/kboot_driver.h"
#include "bootloader/wormhole.h"
#include "peripherals/adc.h"
#include "eeprom.h"
#include "keymaps.h"
#include "microseconds/microseconds_pit.c"
#include "i2c_watchdog.h"
// Functions for setting error statuses
void setError(uint8_t error)
@@ -277,6 +279,13 @@ void jumpToSlaveBootloader(void)
UhkModuleStates[uhkModuleDriverId].jumpToBootloader = true;
}
void sendKbootCommand(void)
{
uint8_t i2cAddress = GenericHidInBuffer[1];
KbootDriverState.i2cAddress = i2cAddress;
KbootDriverState.isTransferScheduled = true;
}
// The main protocol handler function
void UsbProtocolHandler(void)
@@ -331,6 +340,9 @@ void UsbProtocolHandler(void)
case UsbCommand_JumpToSlaveBootloader:
jumpToSlaveBootloader();
break;
case UsbCommand_SendKbootCommand:
sendKbootCommand();
break;
default:
break;
}