Revert external module baudrate configurable
This commit is contained in:
@@ -122,7 +122,6 @@ enum MenuModelSetupItems {
|
||||
ITEM_MODEL_EXTERNAL_MODULE_STATUS,
|
||||
ITEM_MODEL_EXTERNAL_MODULE_SYNCSTATUS,
|
||||
#endif
|
||||
ITEM_MODEL_EXTERNAL_MODULE_BAUDRATE, // TODO remove this when we have adaptative speed
|
||||
ITEM_MODEL_EXTERNAL_MODULE_CHANNELS,
|
||||
ITEM_MODEL_EXTERNAL_MODULE_NPXX2_BIND,
|
||||
ITEM_MODEL_EXTERNAL_MODULE_PXX2_MODEL_NUM,
|
||||
@@ -483,7 +482,6 @@ void menuModelSetup(event_t event)
|
||||
EXTERNAL_MODULE_MODE_ROWS,
|
||||
MULTIMODULE_SUBTYPE_ROWS(EXTERNAL_MODULE)
|
||||
MULTIMODULE_STATUS_ROWS
|
||||
IF_PXX2_MODULE(EXTERNAL_MODULE, 0), // TODO remove this when we have adaptative speed
|
||||
EXTERNAL_MODULE_CHANNELS_ROWS,
|
||||
IF_NOT_PXX2_MODULE(EXTERNAL_MODULE, EXTERNAL_MODULE_BIND_ROWS()), // line reused for PPM: PPM settings
|
||||
IF_PXX2_MODULE(EXTERNAL_MODULE, 0), // RxNum
|
||||
@@ -1166,15 +1164,6 @@ void menuModelSetup(event_t event)
|
||||
break;
|
||||
#endif
|
||||
|
||||
case ITEM_MODEL_EXTERNAL_MODULE_BAUDRATE:
|
||||
extern uint32_t externalModuleBaudrate;
|
||||
lcdDrawTextAlignedLeft(y, INDENT "Baudrate");
|
||||
lcdDrawNumber(MODEL_SETUP_2ND_COLUMN, y, externalModuleBaudrate, attr | LEFT);
|
||||
if (attr) {
|
||||
externalModuleBaudrate = checkIncDec(event, externalModuleBaudrate / 200, 576, 2100) * 200;
|
||||
}
|
||||
break;
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
case ITEM_MODEL_INTERNAL_MODULE_CHANNELS:
|
||||
#endif
|
||||
|
||||
@@ -154,17 +154,8 @@ void extmoduleInvertedSerialStart(uint32_t baudrate)
|
||||
NVIC_EnableIRQ(EXTMODULE_USART_IRQn);
|
||||
}
|
||||
|
||||
// TODO remove this when we have adaptative speed
|
||||
uint32_t externalModuleBaudrate = 230400;
|
||||
uint32_t currentExternalModuleBaudrate = 230400;
|
||||
|
||||
void extmoduleSendBuffer(const uint8_t * data, uint8_t size)
|
||||
{
|
||||
// TODO remove this when we have adaptative speed
|
||||
if (externalModuleBaudrate != currentExternalModuleBaudrate) {
|
||||
extmodulePxx2Start();
|
||||
}
|
||||
|
||||
DMA_InitTypeDef DMA_InitStructure;
|
||||
DMA_DeInit(EXTMODULE_USART_DMA_STREAM);
|
||||
DMA_InitStructure.DMA_Channel = EXTMODULE_USART_DMA_CHANNEL;
|
||||
@@ -213,11 +204,7 @@ extern "C" void EXTMODULE_USART_IRQHandler(void)
|
||||
|
||||
void extmodulePxx2Start()
|
||||
{
|
||||
// TODO remove this when we have adaptative speed
|
||||
currentExternalModuleBaudrate = externalModuleBaudrate;
|
||||
extmoduleInvertedSerialStart(externalModuleBaudrate);
|
||||
|
||||
// extmoduleInvertedSerialStart(EXTMODULE_USART_PXX2_BAUDRATE);
|
||||
extmoduleInvertedSerialStart(EXTMODULE_USART_PXX2_BAUDRATE);
|
||||
}
|
||||
#else
|
||||
void extmodulePxx2Start()
|
||||
|
||||
@@ -179,7 +179,7 @@ uint8_t eepromIsTransferComplete()
|
||||
* @param NumByteToWrite : number of bytes to write to the EEPROM.
|
||||
* @retval None
|
||||
*/
|
||||
bool I2C_EE_PageWrite(uint8_t* pBuffer, uint16_t WriteAddr, uint8_t NumByteToWrite)
|
||||
bool I2C_EE_PageWrite(uint8_t * pBuffer, uint16_t WriteAddr, uint8_t NumByteToWrite)
|
||||
{
|
||||
if (!I2C_WaitEventCleared(I2C_FLAG_BUSY))
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user