Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 1974 → Rev 1980

/branches/dongfang_FC_rewrite/uart0.c
137,11 → 137,11
"Pitch Term ",
"Roll Term ",
"Yaw Term ",
"ca debug ", //15
"Throttle Term ", //15
"gyroP ",
"gyroI ",
"gyroD ",
"unused ",
"Acc Vector ",
"dHeightThrottle ", //20
"hoverThrottle ",
"M1 ",
494,7 → 494,7
// if data in the rxd buffer are not locked immediately return
if (!rxd_buffer_locked)
return;
uint8_t tempchar1, tempchar2;
uint8_t tempchar[3];
Decode64(); // decode data block in rxd_buffer
 
switch (rxd_buffer[1] - 'a') {
529,11 → 529,11
mixerMatrix_writeToEEProm();
while (!txd_complete)
; // wait for previous frame to be sent
tempchar1 = 1;
tempchar[0] = 1;
} else {
tempchar1 = 0;
tempchar[0] = 0;
}
SendOutData('M', FC_ADDRESS, 1, &tempchar1, 1);
SendOutData('M', FC_ADDRESS, 1, &tempchar, 1);
break;
 
case 'p': // get PPM channels
551,13 → 551,12
pRxData[0] = 5; // limit to 5
// load requested parameter set
paramSet_readFromEEProm(pRxData[0]);
tempchar1 = pRxData[0];
tempchar2 = EEPARAM_REVISION;
tempchar[0] = pRxData[0];
tempchar[1] = EEPARAM_REVISION;
tempchar[2] = sizeof(staticParams);
while (!txd_complete)
; // wait for previous frame to be sent
SendOutData('Q', FC_ADDRESS, 3, &tempchar1, sizeof(tempchar1),
&tempchar2, sizeof(tempchar2), (uint8_t *) &staticParams,
sizeof(staticParams));
SendOutData('Q', FC_ADDRESS, 2, &tempchar, 3, (uint8_t *) &staticParams, sizeof(staticParams));
break;
 
case 's': // save settings
568,14 → 567,14
{
memcpy(&staticParams, (uint8_t*) &pRxData[2], sizeof(staticParams));
paramSet_writeToEEProm(pRxData[0]);
tempchar1 = getActiveParamSet();
beepNumber(tempchar1);
tempchar[0] = getActiveParamSet();
beepNumber(tempchar[0]);
} else {
tempchar1 = 0; //indicate bad data
tempchar[0] = 0; //indicate bad data
}
while (!txd_complete)
; // wait for previous frame to be sent
SendOutData('S', FC_ADDRESS, 1, &tempchar1, sizeof(tempchar1));
SendOutData('S', FC_ADDRESS, 1, &tempchar, 1);
}
break;