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

Merge pull request #428 from Pierre-A/update_pa

HoTT check serial data improvement
This commit is contained in:
Dominic Clifton 2015-03-03 10:58:33 +00:00
commit 94fdaed8d2

View file

@ -110,8 +110,6 @@ static telemetryConfig_t *telemetryConfig;
static HOTT_GPS_MSG_t hottGPSMessage;
static HOTT_EAM_MSG_t hottEAMMessage;
static bool useSoftserialRxFailureWorkaround = false;
static void initialiseEAMMessage(HOTT_EAM_MSG_t *msg, size_t size)
{
memset(msg, 0, size);
@ -286,16 +284,6 @@ void configureHoTTTelemetryPort(void)
// FIXME only need to do this if the port is shared
previousPortMode = hottPort->mode;
previousBaudRate = hottPort->baudRate;
#ifdef USE_SOFTSERIAL1
if (hottPort->identifier == SERIAL_PORT_SOFTSERIAL1) {
useSoftserialRxFailureWorkaround = true;
}
#endif
#ifdef USE_SOFTSERIAL2
if (hottPort->identifier == SERIAL_PORT_SOFTSERIAL2) {
useSoftserialRxFailureWorkaround = true;
}
#endif
}
}
@ -378,18 +366,6 @@ static void hottCheckSerialData(uint32_t currentMicros)
uint8_t bytesWaiting = serialTotalBytesWaiting(hottPort);
if (useSoftserialRxFailureWorkaround) {
// FIXME The 0x80 is being read as 0x00 - softserial timing/syncronisation problem somewhere.
if (!bytesWaiting) {
return;
}
uint8_t incomingByte = serialRead(hottPort);
processBinaryModeRequest(incomingByte);
return;
}
if (bytesWaiting <= 1) {
return;
}
@ -416,7 +392,7 @@ static void hottCheckSerialData(uint32_t currentMicros)
uint8_t requestId = serialRead(hottPort);
uint8_t address = serialRead(hottPort);
if (requestId == HOTT_BINARY_MODE_REQUEST_ID) {
if ((requestId == 0) || (requestId == HOTT_BINARY_MODE_REQUEST_ID) || (address == HOTT_TELEMETRY_NO_SENSOR_ID)) {
processBinaryModeRequest(address);
}
}