Rev 1910 | Rev 2102 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1910 | Rev 1927 | ||
---|---|---|---|
Line 492... | Line 492... | ||
492 | if (pRxData[0] < 1) |
492 | if (pRxData[0] < 1) |
493 | pRxData[0] = 1; // limit to 1 |
493 | pRxData[0] = 1; // limit to 1 |
494 | else if (pRxData[0] > 5) |
494 | else if (pRxData[0] > 5) |
495 | pRxData[0] = 5; // limit to 5 |
495 | pRxData[0] = 5; // limit to 5 |
496 | // load requested parameter set |
496 | // load requested parameter set |
497 | ParamSet_ReadFromEEProm(pRxData[0]); |
497 | ParamSet_ReadFromEEProm(); |
498 | tempchar1 = pRxData[0]; |
498 | tempchar1 = pRxData[0]; |
499 | tempchar2 = EEPARAM_REVISION; |
499 | tempchar2 = EEPARAM_REVISION; |
500 | while (!txd_complete) |
500 | while (!txd_complete) |
501 | ; // wait for previous frame to be sent |
501 | ; // wait for previous frame to be sent |
502 | SendOutData('Q', FC_ADDRESS, 3, &tempchar1, sizeof(tempchar1), |
502 | SendOutData('Q', FC_ADDRESS, 3, &tempchar1, sizeof(tempchar1), |
Line 509... | Line 509... | ||
509 | { |
509 | { |
510 | if ((1 <= pRxData[0]) && (pRxData[0] <= 5) && (pRxData[1] |
510 | if ((1 <= pRxData[0]) && (pRxData[0] <= 5) && (pRxData[1] |
511 | == EEPARAM_REVISION)) // check for setting to be in range and version of settings |
511 | == EEPARAM_REVISION)) // check for setting to be in range and version of settings |
512 | { |
512 | { |
513 | memcpy(&staticParams, (uint8_t*) &pRxData[2], sizeof(staticParams)); |
513 | memcpy(&staticParams, (uint8_t*) &pRxData[2], sizeof(staticParams)); |
514 | ParamSet_WriteToEEProm(pRxData[0]); |
514 | ParamSet_WriteToEEProm(); |
515 | tempchar1 = getActiveParamSet(); |
- | |
516 | beepNumber(tempchar1); |
515 | beepNumber(1); |
517 | } else { |
516 | } else { |
518 | tempchar1 = 0; //indicate bad data |
517 | tempchar1 = 0; //indicate bad data |
519 | } |
518 | } |
520 | while (!txd_complete) |
519 | while (!txd_complete) |
521 | ; // wait for previous frame to be sent |
520 | ; // wait for previous frame to be sent |
Line 654... | Line 653... | ||
654 | SendOutData('C', FC_ADDRESS, 1, (uint8_t *) &Data3D, sizeof(Data3D)); |
653 | SendOutData('C', FC_ADDRESS, 1, (uint8_t *) &Data3D, sizeof(Data3D)); |
655 | Data3D.AngleNick = (int16_t) ((10 * angle[PITCH]) |
654 | Data3D.AngleNick = (int16_t) ((10 * angle[PITCH]) |
656 | / GYRO_DEG_FACTOR_PITCHROLL); // convert to multiple of 0.1° |
655 | / GYRO_DEG_FACTOR_PITCHROLL); // convert to multiple of 0.1° |
657 | Data3D.AngleRoll = (int16_t) ((10 * angle[ROLL]) |
656 | Data3D.AngleRoll = (int16_t) ((10 * angle[ROLL]) |
658 | / GYRO_DEG_FACTOR_PITCHROLL); // convert to multiple of 0.1° |
657 | / GYRO_DEG_FACTOR_PITCHROLL); // convert to multiple of 0.1° |
659 | Data3D.Heading = (int16_t) ((10 * yawGyroHeading) / GYRO_DEG_FACTOR_YAW); // convert to multiple of 0.1° |
658 | Data3D.Heading = (int16_t) ((10 * angle[YAW]) / GYRO_DEG_FACTOR_YAW); // convert to multiple of 0.1° |
660 | Data3D_Timer = setDelay(Data3D_Interval); |
659 | Data3D_Timer = setDelay(Data3D_Interval); |
661 | request_Data3D = FALSE; |
660 | request_Data3D = FALSE; |
662 | } |
661 | } |
Line 663... | Line 662... | ||
663 | 662 |