mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-13 19:40:31 +03:00
fixed bug with MTK init - stuff was sent without delay while changing baudrates, and it would wreck stuff - changing rate mid-buffer. oops. should work now.
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@216 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
This commit is contained in:
parent
8e16d83a37
commit
a139b96de6
5 changed files with 2836 additions and 2818 deletions
5643
obj/baseflight.hex
5643
obj/baseflight.hex
File diff suppressed because it is too large
Load diff
|
@ -221,6 +221,11 @@ void uart2Write(uint8_t ch)
|
||||||
USART_ITConfig(USART2, USART_IT_TXE, ENABLE);
|
USART_ITConfig(USART2, USART_IT_TXE, ENABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool uart2TransmitEmpty(void)
|
||||||
|
{
|
||||||
|
return tx2BufferTail == tx2BufferHead;
|
||||||
|
}
|
||||||
|
|
||||||
void USART2_IRQHandler(void)
|
void USART2_IRQHandler(void)
|
||||||
{
|
{
|
||||||
uint16_t SR = USART2->SR;
|
uint16_t SR = USART2->SR;
|
||||||
|
|
|
@ -12,4 +12,5 @@ void uartPrint(char *str);
|
||||||
// USART2 (GPS, Spektrum)
|
// USART2 (GPS, Spektrum)
|
||||||
void uart2Init(uint32_t speed, uartReceiveCallbackPtr func, bool rxOnly);
|
void uart2Init(uint32_t speed, uartReceiveCallbackPtr func, bool rxOnly);
|
||||||
void uart2ChangeBaud(uint32_t speed);
|
void uart2ChangeBaud(uint32_t speed);
|
||||||
|
bool uart2TransmitEmpty(void);
|
||||||
void uart2Write(uint8_t ch);
|
void uart2Write(uint8_t ch);
|
||||||
|
|
|
@ -96,6 +96,9 @@ static void gpsPrint(const char *str)
|
||||||
delay(4);
|
delay(4);
|
||||||
str++;
|
str++;
|
||||||
}
|
}
|
||||||
|
// wait to send all
|
||||||
|
while (!uart2TransmitEmpty());
|
||||||
|
delay(30);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*-----------------------------------------------------------
|
/*-----------------------------------------------------------
|
||||||
|
|
|
@ -289,7 +289,7 @@ float applyDeadbandFloat(float value, int16_t deadband)
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
float InvSqrt (float x)
|
float InvSqrt(float x)
|
||||||
{
|
{
|
||||||
union {
|
union {
|
||||||
int32_t i;
|
int32_t i;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue