Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 1221 → Rev 1222

/branches/V0.73d Code Redesign killagreg/uart0.c
97,7 → 97,9
volatile uint8_t RxDataLen = 0;
 
uint8_t PcAccess = 100;
uint8_t MotorTest[4] = {0,0,0,0};
 
uint8_t MotorTest_Active = 0;
uint8_t MotorTest[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
uint8_t ConfirmFrame;
 
typedef struct
152,7 → 154,7
" ",
"Kalman Max Drift",
" ",
" ",
"Navi Serial Data",
"GPS Nick ", //30
"GPSS Roll "
};
485,11 → 487,39
#endif
 
case 't':// motor test
memcpy(&MotorTest[0], (uint8_t*)pRxData, sizeof(MotorTest));
if(RxDataLen > 20) //
{
memcpy(&MotorTest[0], (uint8_t*)pRxData, sizeof(MotorTest));
}
else
{
memcpy(&MotorTest[0], (uint8_t*)pRxData, 4);
}
//Request_MotorTest = TRUE;
MotorTest_Active = 255;
PcAccess = 255;
break;
 
case 'n':// "Get Mixer Table
while(!txd_complete); // wait for previous frame to be sent
SendOutData('N', FC_ADDRESS, 1, (uint8_t *) &Mixer, sizeof(Mixer));
break;
 
case 'm':// "Set Mixer Table
if(pRxData[0] == EEMIXER_REVISION)
{
memcpy(&Mixer, (uint8_t*)pRxData, sizeof(Mixer));
MixerTable_WriteToEEProm();
while(!txd_complete); // wait for previous frame to be sent
tempchar1 = 1;
}
else
{
tempchar1 = 0;
}
SendOutData('M', FC_ADDRESS, 1, &tempchar1, 1);
break;
 
case 'p': // get PPM channels
Request_PPMChannels = TRUE;
break;
504,9 → 534,8
else if(pRxData[0] > 5) pRxData[0] = 5; // limit to 5
// load requested parameter set
ParamSet_ReadFromEEProm(pRxData[0]);
 
tempchar1 = pRxData[0];
tempchar2 = EEPARAM_VERSION;
tempchar2 = EEPARAM_REVISION;
while(!txd_complete); // wait for previous frame to be sent
SendOutData('Q', FC_ADDRESS,3, &tempchar1, sizeof(tempchar1), &tempchar2, sizeof(tempchar2), (uint8_t *) &ParamSet, sizeof(ParamSet));
break;
514,7 → 543,7
case 's': // save settings
if(!(MKFlags & MKFLAG_MOTOR_RUN)) // save settings only if motors ar off
{
if((1 <= pRxData[0]) && (pRxData[0] <= 5) && (pRxData[1] == EEPARAM_VERSION)) // check for setting to be in range and version of settings
if((1 <= pRxData[0]) && (pRxData[0] <= 5) && (pRxData[1] == EEPARAM_REVISION)) // check for setting to be in range and version of settings
{
memcpy(&ParamSet, (uint8_t*)&pRxData[2], sizeof(ParamSet));
ParamSet_WriteToEEProm(pRxData[0]);
680,6 → 709,7
Compass_Timer = SetDelay(99);
}
#endif
 
if(Request_MotorTest && txd_complete)
{
SendOutData('T', FC_ADDRESS, 0);