Commits (1)
......@@ -91,8 +91,18 @@ void rc_callback_handler(RC_ctrl_t *rc_ctrl, uint8_t *buff)
rc_ctrl->rc.ch[0] = (buff[4] >> 1 | buff[5] << 7) & 0x07FF;
rc_ctrl->rc.ch[0] -= 1024;
rc_ctrl->rc.sw[0] = ((buff[5] >> 4) & 0x000C) >> 2;
rc_ctrl->rc.sw[1] = (buff[5] >> 4) & 0x0003;
rc_ctrl->rc.sw[0] = ((buff[5] >> 4) & 0x000C) >> 2; //!< Switch right
rc_ctrl->rc.sw[1] = (buff[5] >> 4) & 0x0003; //!< Switch left
rc_ctrl->mouse.x = buff[6] | (buff[7] << 8); //!< Mouse X axis
rc_ctrl->mouse.y = buff[8] | (buff[9] << 8); //!< Mouse Y axis
rc_ctrl->mouse.z = buff[10] | (buff[11] << 8); //!< Mouse Z axis
rc_ctrl->mouse.press_l = buff[12]; //!< Mouse Left Is Press ?
rc_ctrl->mouse.press_r = buff[13]; //!< Mouse Right Is Press ?
rc_ctrl->key.v = buff[14] | (buff[15] << 8); //!< KeyBoard value
rc_ctrl->rc.ch[4] = buff[16] | (buff[17] << 8); //!< Left Dial
rc_ctrl->rc.ch[4] -= 1024;
if ((abs(rc_ctrl->rc.ch[0]) > 660) || \
(abs(rc_ctrl->rc.ch[1]) > 660) || \
......