Skip to content

Commit

Permalink
Write incoming Bluetooth data over I2C to avoid UART2 corruptions
Browse files Browse the repository at this point in the history
See issue 469
  • Loading branch information
nseidle committed Jun 12, 2023
1 parent 3202cc5 commit 2021f64
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions Firmware/RTK_Surveyor/Tasks.ino
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ void btReadTask(void *e)
{
// Ignore this escape character, passing along to output
if (USE_I2C_GNSS)
serialGNSS.write(incoming);
{
// serialGNSS.write(incoming);
theGNSS.pushRawData(&incoming, 1);
}
else
theGNSS.pushRawData(&incoming, 1);
}
Expand All @@ -50,7 +53,11 @@ void btReadTask(void *e)
while (btEscapeCharsReceived-- > 0)
{
if (USE_I2C_GNSS)
serialGNSS.write(btEscapeCharacter);
{
// serialGNSS.write(btEscapeCharacter);
uint8_t escChar = btEscapeCharacter;
theGNSS.pushRawData(&escChar, 1);
}
else
{
uint8_t escChar = btEscapeCharacter;
Expand All @@ -61,7 +68,12 @@ void btReadTask(void *e)
// Pass byte to GNSS receiver or to system
// TODO - control if this RTCM source should be listened to or not
if (USE_I2C_GNSS)
serialGNSS.write(incoming);
{
// UART RX can be corrupted by UART TX
// See issue: https://github.com/sparkfun/SparkFun_RTK_Firmware/issues/469
// serialGNSS.write(incoming);
theGNSS.pushRawData(&incoming, 1);
}
else
theGNSS.pushRawData(&incoming, 1);

Expand Down

0 comments on commit 2021f64

Please sign in to comment.