mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 16:25:31 +03:00
fixed SITL target debug build and runtime segfaults. Added motorPwmDevice vTable functions and IOConfigGPIO stub
This commit is contained in:
parent
6433aaa688
commit
548379bab0
2 changed files with 13 additions and 6 deletions
|
@ -538,7 +538,7 @@ void init(void)
|
||||||
busSwitchInit();
|
busSwitchInit();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(USE_UART)
|
#if defined(USE_UART) && !defined(SIMULATOR_BUILD)
|
||||||
uartPinConfigure(serialPinConfig());
|
uartPinConfigure(serialPinConfig());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -232,7 +232,7 @@ void systemInit(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = udpInit(&pwmLink, "127.0.0.1", 9002, false);
|
ret = udpInit(&pwmLink, "127.0.0.1", 9002, false);
|
||||||
printf("init PwnOut UDP link...%d\n", ret);
|
printf("init PwmOut UDP link...%d\n", ret);
|
||||||
|
|
||||||
ret = udpInit(&stateLink, NULL, 9003, true);
|
ret = udpInit(&stateLink, NULL, 9003, true);
|
||||||
printf("start UDP server...%d\n", ret);
|
printf("start UDP server...%d\n", ret);
|
||||||
|
@ -439,6 +439,10 @@ static void pwmShutdownPulsesForAllMotors(void)
|
||||||
motorPwmDevice.enabled = false;
|
motorPwmDevice.enabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool pwmIsMotorEnabled(uint8_t index) {
|
||||||
|
return motors[index].enabled;
|
||||||
|
}
|
||||||
|
|
||||||
static void pwmCompleteMotorUpdate(void)
|
static void pwmCompleteMotorUpdate(void)
|
||||||
{
|
{
|
||||||
// send to simulator
|
// send to simulator
|
||||||
|
@ -466,10 +470,12 @@ void pwmWriteServo(uint8_t index, float value) {
|
||||||
|
|
||||||
static motorDevice_t motorPwmDevice = {
|
static motorDevice_t motorPwmDevice = {
|
||||||
.vTable = {
|
.vTable = {
|
||||||
|
.postInit = motorPostInitNull,
|
||||||
.convertExternalToMotor = pwmConvertFromExternal,
|
.convertExternalToMotor = pwmConvertFromExternal,
|
||||||
.convertMotorToExternal = pwmConvertToExternal,
|
.convertMotorToExternal = pwmConvertToExternal,
|
||||||
.enable = pwmEnableMotors,
|
.enable = pwmEnableMotors,
|
||||||
.disable = pwmDisableMotors,
|
.disable = pwmDisableMotors,
|
||||||
|
.isMotorEnabled = pwmIsMotorEnabled,
|
||||||
.updateStart = motorUpdateStartNull,
|
.updateStart = motorUpdateStartNull,
|
||||||
.write = pwmWriteMotor,
|
.write = pwmWriteMotor,
|
||||||
.writeInt = pwmWriteMotorInt,
|
.writeInt = pwmWriteMotorInt,
|
||||||
|
@ -574,14 +580,15 @@ FLASH_Status FLASH_ProgramWord(uintptr_t addr, uint32_t value) {
|
||||||
return FLASH_COMPLETE;
|
return FLASH_COMPLETE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void uartPinConfigure(const serialPinConfig_t *pSerialPinConfig)
|
void IOConfigGPIO(IO_t io, ioConfig_t cfg)
|
||||||
{
|
{
|
||||||
UNUSED(pSerialPinConfig);
|
UNUSED(io);
|
||||||
printf("uartPinConfigure");
|
UNUSED(cfg);
|
||||||
|
printf("IOConfigGPIO\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void spektrumBind(rxConfig_t *rxConfig)
|
void spektrumBind(rxConfig_t *rxConfig)
|
||||||
{
|
{
|
||||||
UNUSED(rxConfig);
|
UNUSED(rxConfig);
|
||||||
printf("spektrumBind");
|
printf("spektrumBind\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue