Skip to content

Commit

Permalink
SBUS decoding: Fix channel 18 return value
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzMeier committed May 21, 2016
1 parent 87a6d36 commit 0902401
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/rc/sbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -606,9 +606,9 @@ sbus_decode(uint64_t frame_time, uint8_t *frame, uint16_t *values, uint16_t *num
chancount = 18;

/* channel 17 (index 16) */
values[16] = (frame[SBUS_FLAGS_BYTE] & (1 << 0)) * 1000 + 998;
values[16] = (((frame[SBUS_FLAGS_BYTE] & (1 << 0)) > 0) ? 1 : 0) * 1000 + 998;
/* channel 18 (index 17) */
values[17] = (frame[SBUS_FLAGS_BYTE] & (1 << 1)) * 1000 + 998;
values[17] = (((frame[SBUS_FLAGS_BYTE] & (1 << 1)) > 0) ? 1 : 0) * 1000 + 998;
}

/* note the number of channels decoded */
Expand Down

0 comments on commit 0902401

Please sign in to comment.