Rev 2095 | Rev 2158 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2095 | Rev 2097 | ||
---|---|---|---|
Line 498... | Line 498... | ||
498 | 498 | ||
499 | case 'p': // get PPM channels |
499 | case 'p': // get PPM channels |
500 | request_PPMChannels = TRUE; |
500 | request_PPMChannels = TRUE; |
Line 501... | Line 501... | ||
501 | break; |
501 | break; |
502 | 502 | ||
503 | case 'i':// IMU configuration |
503 | case 'i':// Read IMU configuration |
504 | tempchar[0] = IMUCONFIG_REVISION; |
504 | tempchar[0] = IMUCONFIG_REVISION; |
505 | tempchar[1] = sizeof(IMUConfig); |
505 | tempchar[1] = sizeof(IMUConfig); |
506 | while (!txd_complete) |
506 | while (!txd_complete) |
507 | ; // wait for previous frame to be sent |
507 | ; // wait for previous frame to be sent |
Line -... | Line 508... | ||
- | 508 | sendOutData('I', FC_ADDRESS, 2, &tempchar, 2, (uint8_t *) &IMUConfig, sizeof(IMUConfig)); |
|
- | 509 | break; |
|
- | 510 | ||
- | 511 | case 'j':// Save IMU configuration |
|
- | 512 | if (!(MKFlags & MKFLAG_MOTOR_RUN)) // save settings only if motors are off |
|
- | 513 | { |
|
- | 514 | if ((pRxData[0] == IMUCONFIG_REVISION) && (pRxData[1] == sizeof(IMUConfig))) { |
|
- | 515 | memcpy(&IMUConfig, (uint8_t*) &pRxData[2], sizeof(IMUConfig)); |
|
- | 516 | IMUConfig_writeToEEprom(); |
|
- | 517 | tempchar[0] = 1; //indicate ok data |
|
- | 518 | } else { |
|
- | 519 | tempchar[0] = 0; //indicate bad data |
|
- | 520 | } |
|
- | 521 | while (!txd_complete) |
|
- | 522 | ; // wait for previous frame to be sent |
|
- | 523 | sendOutData('J', FC_ADDRESS, 1, &tempchar, 1); |
|
508 | sendOutData('I', FC_ADDRESS, 2, &tempchar, 2, (uint8_t *) &IMUConfig, sizeof(IMUConfig)); |
524 | } |
509 | break; |
525 | break; |
510 | 526 | ||
511 | case 'q':// request settings |
527 | case 'q':// request settings |
512 | if (pRxData[0] == 0xFF) { |
528 | if (pRxData[0] == 0xFF) { |