1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 00:05:33 +03:00

Support UART3 and I2C on Paris Air Hero 32 Flex port (aka Naze32_SP).

This change also allows serial ports to be removed at runtime.  e.g.
UART3 on Naze32 and SoftSerial 1 & 2 when softserial is not enabled.
This commit is contained in:
Dominic Clifton 2015-05-22 20:48:39 +01:00
parent f2013ab863
commit a370d60595
5 changed files with 92 additions and 18 deletions

View file

@ -278,10 +278,22 @@ void init(void)
updateHardwareRevision();
#endif
#if defined(NAZE)
if (hardwareRevision == NAZE32_SP) {
serialRemovePort(SERIAL_PORT_SOFTSERIAL2);
} else {
serialRemovePort(SERIAL_PORT_USART3);
}
#endif
#ifdef USE_I2C
#if defined(NAZE)
if (hardwareRevision != NAZE32_SP) {
i2cInit(I2C_DEVICE);
} else {
if (!doesConfigurationUsePort(SERIAL_PORT_USART3)) {
i2cInit(I2C_DEVICE);
}
}
#elif defined(CC3D)
if (!doesConfigurationUsePort(SERIAL_PORT_USART3)) {