1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-06 21:54:15 +01:00

OP-174 ET OSD, do not return from task, the system seems to crash when you do that; anyway the thread will be removed

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2625 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
FredericG 2011-01-29 17:47:40 +00:00 committed by FredericG
parent 04d3a9649d
commit a8bd4d28ad

View File

@ -250,12 +250,14 @@ static bool Write(uint32_t start, uint8_t length, const uint8_t * buffer)
static uint32_t ReadSwVersion(void) static uint32_t ReadSwVersion(void)
{ {
uint8_t buf[4]; uint8_t buf[4];
uint32_t version = 0; uint32_t version;
if (Read(0, 4, buf)) { if (Read(0, 4, buf)) {
version = (buf[0] - '0') * 100; version = (buf[0] - '0') * 100;
version += (buf[2] - '0') * 10; version += (buf[2] - '0') * 10;
version += (buf[3] - '0'); version += (buf[3] - '0');
} else {
version = 0;
} }
return version; return version;
@ -381,12 +383,19 @@ static void Task(void *parameters)
FlightBatteryStateConnectCallback(FlightBatteryStateUpdatedCb); FlightBatteryStateConnectCallback(FlightBatteryStateUpdatedCb);
DEBUG_MSG("OSD ET Std\n"); DEBUG_MSG("OSD ET Std\n");
version = ReadSwVersion();
DEBUG_MSG("SW: %d\n", version);
if (version != 115) { // Wait until OSD is detected
DEBUG_MSG("INVALID SW VERSION\n"); while(1) {
return; version = ReadSwVersion();
DEBUG_MSG("SW: %d ", version);
if (version == 115) {
DEBUG_MSG("OK\n");
break;
} else {
DEBUG_MSG("INVALID\n");
vTaskDelay(1000 / portTICK_RATE_MS);
}
} }
UpdateConfig(); UpdateConfig();