117,8 → 117,10 |
|
uint16_t DebugData_Timer; |
uint16_t Data3D_Timer; |
uint16_t Display_Timer; |
uint16_t DebugData_Interval = 500; // in 1ms |
uint16_t Data3D_Interval = 0; // in 1ms |
uint16_t Display_Interval = 0; |
|
#ifdef USE_MK3MAG |
int16_t Compass_Timer; |
608,8 → 610,17 |
|
case 'h':// request for display columns |
PcAccess = 255; |
RemoteKeys |= pRxData[0]; |
if(RemoteKeys) DisplayLine = 0; |
if((pRxData[0] & 0x80) == 0x00) // old format |
{ |
DisplayLine = 2; |
Display_Interval = 0; |
} |
else // new format |
{ |
RemoteKeys |= ~pRxData[0]; |
Display_Interval = (uint16_t) pRxData[1] * 10; |
DisplayLine = 4; |
} |
Request_Display = TRUE; |
break; |
|
674,12 → 685,20 |
SendOutData('V', FC_ADDRESS, 1, (uint8_t *) &UART_VersionInfo, sizeof(UART_VersionInfo)); |
Request_VerInfo = FALSE; |
} |
else if(Request_Display && txd_complete) |
else if( (((Display_Interval > 0) && CheckDelay(Display_Timer)) || Request_Display) && txd_complete) |
{ |
if(DisplayLine > 3)// new format |
{ |
LCD_PrintMenu(); |
SendOutData('H', FC_ADDRESS, 2, &DisplayLine, sizeof(DisplayLine), &DisplayBuff[DisplayLine * 20], 20); |
DisplayLine++; |
if(DisplayLine >= 4) DisplayLine = 0; |
SendOutData('H', FC_ADDRESS, 1, (uint8_t *)DisplayBuff, 80); |
} |
else // old format |
{ |
sprintf(DisplayBuff, "!!! INCOMPATIBLE !!!"); |
SendOutData('H', FC_ADDRESS, 2, &DisplayLine, sizeof(DisplayLine), (uint8_t *)DisplayBuff, 20); |
if(DisplayLine++ > 3) DisplayLine = 0; |
} |
Display_Timer = SetDelay(Display_Interval); |
Request_Display = FALSE; |
} |
else if(Request_Display1 && txd_complete) |
720,7 → 739,6 |
SendOutData('G', FC_ADDRESS, 1,(uint8_t *) &ExternControl, sizeof(ExternControl)); |
Request_ExternalControl = FALSE; |
} |
|
#ifdef USE_MK3MAG |
else if((CheckDelay(Compass_Timer)) && txd_complete) |
{ |