MCPcopy Create free account
hub / github.com/OpenHD/OpenHD / write_matching_axis

Method write_matching_axis

OpenHD/ohd_telemetry/src/rc/JoystickReader.cpp:282–291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280}
281
282void JoystickReader::write_matching_axis(
283 std::array<uint16_t, JoystickReader::N_CHANNELS>& rc_data,
284 const uint8_t axis_index, const Sint16 value) {
285 if (axis_index >= N_CHANNELS_RESERVED_FOR_AXES) {
286 m_console->warn("only {} channels reserved for axis, wanted {}",
287 N_CHANNELS_RESERVED_FOR_AXES, axis_index);
288 return;
289 }
290 rc_data[axis_index] = remap_sdl_to_mavlink(value);
291}
292
293void JoystickReader::write_matching_button(std::array<uint16_t, 18>& rc_data,
294 const Uint8 button, bool up) {

Callers

nothing calls this directly

Calls 1

remap_sdl_to_mavlinkFunction · 0.85

Tested by

no test coverage detected