Rev 2039 | Rev 2099 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 2039 | Rev 2041 | ||
|---|---|---|---|
| Line 366... | Line 366... | ||
| 366 | //debugData = *((str_DebugOut*)pRxData); |
366 | //debugData = *((str_DebugOut*)pRxData); |
| 367 | memcpy((char*)(&debugData), (char*)pRxData, sizeof(str_DebugOut)); |
367 | memcpy((char*)(&debugData), (char*)pRxData, sizeof(str_DebugOut)); |
| 368 | rxd_buffer_locked = 0; |
368 | rxd_buffer_locked = 0; |
| Line 369... | Line 369... | ||
| 369 | 369 | ||
| 370 | // init on first data retrival, distinguished by last battery :) |
370 | // init on first data retrival, distinguished by last battery :) |
| 371 | if (last_UBat == 255) { |
371 | if (!(COSD_FLAGS_RUNTIME & COSD_OSD_STARTED)) { |
| 372 | if (debugData.Analog[9] > 40) { |
372 | if (debugData.Analog[9] > 40) { |
| 373 | // fix for min_UBat |
373 | // fix for min_UBat |
| 374 | min_UBat = debugData.Analog[9]; |
374 | min_UBat = debugData.Analog[9]; |
| 375 | last_UBat = debugData.Analog[9]; |
375 | last_UBat = debugData.Analog[9]; |
| - | 376 | init_cosd(last_UBat); |
|
| 376 | init_cosd(last_UBat); |
377 | COSD_FLAGS_RUNTIME |= COSD_OSD_STARTED; |
| 377 | } |
378 | } |
| 378 | } else { |
379 | } else { |
| 379 | osd_fcmode(); |
380 | osd_fcmode(); |
| 380 | } |
381 | } |
| Line 394... | Line 395... | ||
| 394 | naviData.AngleRoll = (int8_t)(((int16_t)naviData.AngleRoll - (int16_t)naviData.AngleNick) / 2); |
395 | naviData.AngleRoll = (int8_t)(((int16_t)naviData.AngleRoll - (int16_t)naviData.AngleNick) / 2); |
| 395 | naviData.CompassHeading = (naviData.CompassHeading + (360 - 45)) % 360; |
396 | naviData.CompassHeading = (naviData.CompassHeading + (360 - 45)) % 360; |
| 396 | #endif |
397 | #endif |
| Line 397... | Line 398... | ||
| 397 | 398 | ||
| 398 | // init on first data retrival, distinguished by last battery :) |
399 | // init on first data retrival, distinguished by last battery :) |
| 399 | if (last_UBat == 255) { |
400 | if (!(COSD_FLAGS_RUNTIME & COSD_OSD_STARTED)) { |
| 400 | if (naviData.UBat > 40) { |
401 | if (naviData.UBat > 40) { |
| 401 | // fix for min_UBat |
402 | // fix for min_UBat |
| 402 | min_UBat = naviData.UBat; |
403 | min_UBat = naviData.UBat; |
| 403 | last_UBat = naviData.UBat; |
404 | last_UBat = naviData.UBat; |
| - | 405 | init_cosd(last_UBat); |
|
| 404 | init_cosd(last_UBat); |
406 | COSD_FLAGS_RUNTIME |= COSD_OSD_STARTED; |
| 405 | } |
407 | } |
| 406 | } else { |
408 | } else { |
| 407 | osd_ncmode(); |
409 | osd_ncmode(); |
| 408 | } |
410 | } |