Fixes. Flash an external module should work
This commit is contained in:
@@ -192,6 +192,8 @@ void extmodulePpmStart();
|
||||
void extmodulePxxStart();
|
||||
void extmodulePxx2Start();
|
||||
void extmoduleSerialStart(uint32_t baudrate, uint32_t period_half_us);
|
||||
void extmoduleInvertedSerialStart(uint32_t baudrate);
|
||||
void extmoduleSendBuffer(const uint8_t * data, uint8_t size);
|
||||
void extmoduleSendNextFrame();
|
||||
|
||||
// Trainer driver
|
||||
|
||||
@@ -147,12 +147,14 @@ void extmoduleInvertedSerialStart(uint32_t baudrate)
|
||||
USART_Init(EXTMODULE_USART, &USART_InitStructure);
|
||||
USART_Cmd(EXTMODULE_USART, ENABLE);
|
||||
|
||||
extmoduleFifo.clear();
|
||||
|
||||
USART_ITConfig(INTMODULE_USART, USART_IT_RXNE, ENABLE);
|
||||
NVIC_SetPriority(EXTMODULE_USART_IRQn, 6);
|
||||
NVIC_EnableIRQ(EXTMODULE_USART_IRQn);
|
||||
}
|
||||
|
||||
void extmoduleSendSerialBuffer(const uint8_t * data, uint8_t size)
|
||||
void extmoduleSendBuffer(const uint8_t * data, uint8_t size)
|
||||
{
|
||||
DMA_InitTypeDef DMA_InitStructure;
|
||||
DMA_DeInit(EXTMODULE_USART_DMA_STREAM);
|
||||
@@ -295,7 +297,7 @@ void extmoduleSendNextFrame()
|
||||
#if defined(PXX2)
|
||||
else if (moduleSettings[EXTERNAL_MODULE].protocol == PROTOCOL_CHANNELS_PXX2) {
|
||||
#if defined(EXTMODULE_USART)
|
||||
extmoduleSendSerialBuffer(extmodulePulsesData.pxx2.getData(), extmodulePulsesData.pxx2.getSize());
|
||||
extmoduleSendBuffer(extmodulePulsesData.pxx2.getData(), extmodulePulsesData.pxx2.getSize());
|
||||
#else
|
||||
sportSendBuffer(extmodulePulsesData.pxx2.getData(), extmodulePulsesData.pxx2.getSize());
|
||||
#endif
|
||||
|
||||
@@ -1284,7 +1284,7 @@
|
||||
#define BT_RCC_AHB1Periph (RCC_AHB1Periph_GPIOD | RCC_AHB1Periph_GPIOE | RCC_AHB1Periph_GPIOG)
|
||||
#define BT_RCC_APB1Periph 0
|
||||
#define BT_RCC_APB2Periph RCC_APB2Periph_USART6
|
||||
#define BT_GPIO_TXRX GPIOG
|
||||
#define BT_USART_GPIO GPIOG
|
||||
#define BT_TX_GPIO_PIN GPIO_Pin_14 // PG.14
|
||||
#define BT_RX_GPIO_PIN GPIO_Pin_9 // PG.09
|
||||
#define BT_EN_GPIO GPIOD
|
||||
@@ -1306,7 +1306,7 @@
|
||||
#else
|
||||
#define BT_EN_GPIO_PIN GPIO_Pin_12 // PE.12
|
||||
#endif
|
||||
#define BT_GPIO_TXRX GPIOB
|
||||
#define BT_USART_GPIO GPIOB
|
||||
#define BT_TX_GPIO_PIN GPIO_Pin_10 // PB.10
|
||||
#define BT_RX_GPIO_PIN GPIO_Pin_11 // PB.11
|
||||
#define BT_TX_GPIO_PinSource GPIO_PinSource10
|
||||
|
||||
Reference in New Issue
Block a user