| 37 | } |
| 38 | |
| 39 | uint32_t SerialDisplayport::sendRCFrame(bool frameAvailable, bool frameMissed, uint32_t *channelData) |
| 40 | { |
| 41 | bool armed = getArmedState(); |
| 42 | |
| 43 | msp_status_t status; |
| 44 | status.task_delta_time = 0; |
| 45 | status.i2c_error_count = 0; |
| 46 | status.sensor_status = 0; |
| 47 | status.flight_mode_flags = armed ? 0x1 : 0x0; |
| 48 | status.pid_profile = 0; |
| 49 | status.system_load = 0; |
| 50 | status.gyro_cycle_time = 0; |
| 51 | status.box_mode_flags = 0; |
| 52 | status.arming_disable_flags_count = 1; |
| 53 | status.arming_disable_flags = armed ? 0x0 : 0x1; |
| 54 | status.extra_flags = 0; |
| 55 | |
| 56 | // Send status MSP |
| 57 | send(MSP_STATUS, &status, sizeof(status), _outputPort); |
| 58 | |
| 59 | // Send extended status MSP |
| 60 | send(MSP_STATUS_EX, &status, sizeof(status), _outputPort); |
| 61 | |
| 62 | return MSP_MSG_PERIOD_MS; // Send MSP msgs to DJI at 10Hz |
| 63 | } |
| 64 | |
| 65 | void SerialDisplayport::processBytes(uint8_t *bytes, u_int16_t size) |
| 66 | { |