MCPcopy Create free account
hub / github.com/ExpressLRS/ExpressLRS / sendRCFrame

Method sendRCFrame

src/src/rx-serial/SerialDisplayport.cpp:39–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39uint32_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
65void SerialDisplayport::processBytes(uint8_t *bytes, u_int16_t size)
66{

Callers

nothing calls this directly

Calls 1

sendFunction · 0.85

Tested by

no test coverage detected