Rev 1974 | Rev 2018 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1974 | Rev 1980 | ||
---|---|---|---|
Line 135... | Line 135... | ||
135 | "AccRoll (angle) ", //10 |
135 | "AccRoll (angle) ", //10 |
136 | "UBat ", |
136 | "UBat ", |
137 | "Pitch Term ", |
137 | "Pitch Term ", |
138 | "Roll Term ", |
138 | "Roll Term ", |
139 | "Yaw Term ", |
139 | "Yaw Term ", |
140 | "ca debug ", //15 |
140 | "Throttle Term ", //15 |
141 | "gyroP ", |
141 | "gyroP ", |
142 | "gyroI ", |
142 | "gyroI ", |
143 | "gyroD ", |
143 | "gyroD ", |
144 | "unused ", |
144 | "Acc Vector ", |
145 | "dHeightThrottle ", //20 |
145 | "dHeightThrottle ", //20 |
146 | "hoverThrottle ", |
146 | "hoverThrottle ", |
147 | "M1 ", |
147 | "M1 ", |
148 | "M2 ", |
148 | "M2 ", |
149 | "M3 ", |
149 | "M3 ", |
Line 492... | Line 492... | ||
492 | if (motorTestActive) |
492 | if (motorTestActive) |
493 | motorTestActive--; |
493 | motorTestActive--; |
494 | // if data in the rxd buffer are not locked immediately return |
494 | // if data in the rxd buffer are not locked immediately return |
495 | if (!rxd_buffer_locked) |
495 | if (!rxd_buffer_locked) |
496 | return; |
496 | return; |
497 | uint8_t tempchar1, tempchar2; |
497 | uint8_t tempchar[3]; |
498 | Decode64(); // decode data block in rxd_buffer |
498 | Decode64(); // decode data block in rxd_buffer |
Line 499... | Line 499... | ||
499 | 499 | ||
Line 500... | Line 500... | ||
500 | switch (rxd_buffer[1] - 'a') { |
500 | switch (rxd_buffer[1] - 'a') { |
Line 527... | Line 527... | ||
527 | if (pRxData[0] == EEMIXER_REVISION) { |
527 | if (pRxData[0] == EEMIXER_REVISION) { |
528 | memcpy(&mixerMatrix, (uint8_t*) pRxData, sizeof(mixerMatrix)); |
528 | memcpy(&mixerMatrix, (uint8_t*) pRxData, sizeof(mixerMatrix)); |
529 | mixerMatrix_writeToEEProm(); |
529 | mixerMatrix_writeToEEProm(); |
530 | while (!txd_complete) |
530 | while (!txd_complete) |
531 | ; // wait for previous frame to be sent |
531 | ; // wait for previous frame to be sent |
532 | tempchar1 = 1; |
532 | tempchar[0] = 1; |
533 | } else { |
533 | } else { |
534 | tempchar1 = 0; |
534 | tempchar[0] = 0; |
535 | } |
535 | } |
536 | SendOutData('M', FC_ADDRESS, 1, &tempchar1, 1); |
536 | SendOutData('M', FC_ADDRESS, 1, &tempchar, 1); |
537 | break; |
537 | break; |
Line 538... | Line 538... | ||
538 | 538 | ||
539 | case 'p': // get PPM channels |
539 | case 'p': // get PPM channels |
540 | request_PPMChannels = TRUE; |
540 | request_PPMChannels = TRUE; |
Line 549... | Line 549... | ||
549 | pRxData[0] = 1; // limit to 1 |
549 | pRxData[0] = 1; // limit to 1 |
550 | else if (pRxData[0] > 5) |
550 | else if (pRxData[0] > 5) |
551 | pRxData[0] = 5; // limit to 5 |
551 | pRxData[0] = 5; // limit to 5 |
552 | // load requested parameter set |
552 | // load requested parameter set |
553 | paramSet_readFromEEProm(pRxData[0]); |
553 | paramSet_readFromEEProm(pRxData[0]); |
554 | tempchar1 = pRxData[0]; |
554 | tempchar[0] = pRxData[0]; |
555 | tempchar2 = EEPARAM_REVISION; |
555 | tempchar[1] = EEPARAM_REVISION; |
- | 556 | tempchar[2] = sizeof(staticParams); |
|
556 | while (!txd_complete) |
557 | while (!txd_complete) |
557 | ; // wait for previous frame to be sent |
558 | ; // wait for previous frame to be sent |
558 | SendOutData('Q', FC_ADDRESS, 3, &tempchar1, sizeof(tempchar1), |
559 | SendOutData('Q', FC_ADDRESS, 2, &tempchar, 3, (uint8_t *) &staticParams, sizeof(staticParams)); |
559 | &tempchar2, sizeof(tempchar2), (uint8_t *) &staticParams, |
- | |
560 | sizeof(staticParams)); |
- | |
561 | break; |
560 | break; |
Line 562... | Line 561... | ||
562 | 561 | ||
563 | case 's': // save settings |
562 | case 's': // save settings |
564 | if (!(MKFlags & MKFLAG_MOTOR_RUN)) // save settings only if motors are off |
563 | if (!(MKFlags & MKFLAG_MOTOR_RUN)) // save settings only if motors are off |
565 | { |
564 | { |
566 | if ((1 <= pRxData[0]) && (pRxData[0] <= 5) && (pRxData[1] |
565 | if ((1 <= pRxData[0]) && (pRxData[0] <= 5) && (pRxData[1] |
567 | == EEPARAM_REVISION)) // check for setting to be in range and version of settings |
566 | == EEPARAM_REVISION)) // check for setting to be in range and version of settings |
568 | { |
567 | { |
569 | memcpy(&staticParams, (uint8_t*) &pRxData[2], sizeof(staticParams)); |
568 | memcpy(&staticParams, (uint8_t*) &pRxData[2], sizeof(staticParams)); |
570 | paramSet_writeToEEProm(pRxData[0]); |
569 | paramSet_writeToEEProm(pRxData[0]); |
571 | tempchar1 = getActiveParamSet(); |
570 | tempchar[0] = getActiveParamSet(); |
572 | beepNumber(tempchar1); |
571 | beepNumber(tempchar[0]); |
573 | } else { |
572 | } else { |
574 | tempchar1 = 0; //indicate bad data |
573 | tempchar[0] = 0; //indicate bad data |
575 | } |
574 | } |
576 | while (!txd_complete) |
575 | while (!txd_complete) |
577 | ; // wait for previous frame to be sent |
576 | ; // wait for previous frame to be sent |
578 | SendOutData('S', FC_ADDRESS, 1, &tempchar1, sizeof(tempchar1)); |
577 | SendOutData('S', FC_ADDRESS, 1, &tempchar, 1); |
579 | } |
578 | } |
Line 580... | Line 579... | ||
580 | break; |
579 | break; |
581 | 580 |