Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alberto Ruiz Garcia
Firmware
Commits
9ebd052a
Commit
9ebd052a
authored
6 years ago
by
Beat Küng
Browse files
Options
Downloads
Patches
Plain Diff
sbus: remove unused variables & improve some comments
parent
22511508
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/lib/rc/sbus.cpp
+3
-13
3 additions, 13 deletions
src/lib/rc/sbus.cpp
with
3 additions
and
13 deletions
src/lib/rc/sbus.cpp
+
3
−
13
View file @
9ebd052a
...
...
@@ -76,12 +76,6 @@
// this is the rate of the old code
#define SBUS1_DEFAULT_RATE_HZ 72
#define SBUS_SINGLE_CHAR_LEN_US (1/((100000/10)) * 1000 * 1000)
#define SBUS_FRAME_INTERVAL_US 2500
#define SBUS_MIN_CALL_INTERVAL_US (SBUS_FRAME_GAP_US / 3)
#define SBUS_EPSILON_US 2500
/*
Measured values with Futaba FX-30/R6108SB:
-+100% on TX: PCM 1.100/1.520/1.950ms -> SBus raw values: 350/1024/1700 (100% ATV)
...
...
@@ -105,7 +99,6 @@
#define SBUS_SCALE_OFFSET (int)(SBUS_TARGET_MIN - (SBUS_SCALE_FACTOR * SBUS_RANGE_MIN + 0.5f))
static
hrt_abstime
last_rx_time
;
static
hrt_abstime
last_frame_time
;
static
hrt_abstime
last_txframe_time
=
0
;
#define SBUS2_FRAME_SIZE_RX_VOLTAGE 3
...
...
@@ -229,7 +222,6 @@ sbus_config(int sbus_fd, bool singlewire)
/* initialise the decoder */
partial_frame_count
=
0
;
last_rx_time
=
hrt_absolute_time
();
last_frame_time
=
last_rx_time
;
sbus_frame_drops
=
0
;
ret
=
0
;
...
...
@@ -404,8 +396,7 @@ sbus_parse(uint64_t now, uint8_t *frame, unsigned len, uint16_t *values,
}
/*
* Great, it looks like we might have a frame. Go ahead and
* decode it.
* Great, it looks like we might have a frame. Go ahead and decode it.
*/
decode_ret
=
sbus_decode
(
now
,
sbus_frame
,
values
,
num_values
,
sbus_failsafe
,
sbus_frame_drop
,
max_channels
);
...
...
@@ -582,7 +573,7 @@ sbus_decode(uint64_t frame_time, uint8_t *frame, uint16_t *values, uint16_t *num
{
/* check frame boundary markers to avoid out-of-sync cases */
if
(
(
frame
[
0
]
!=
SBUS_START_SYMBOL
)
)
{
if
(
frame
[
0
]
!=
SBUS_START_SYMBOL
)
{
sbus_frame_drops
++
;
#if defined(SBUS_DEBUG_LEVEL) && SBUS_DEBUG_LEVEL > 0
printf
(
"DECODE FAIL: "
);
...
...
@@ -597,6 +588,7 @@ sbus_decode(uint64_t frame_time, uint8_t *frame, uint16_t *values, uint16_t *num
return
false
;
}
/* the last byte in the frame indicates what frame will follow after this one */
switch
(
frame
[
24
])
{
case
0x00
:
/* this is S.BUS 1 */
...
...
@@ -632,8 +624,6 @@ sbus_decode(uint64_t frame_time, uint8_t *frame, uint16_t *values, uint16_t *num
}
/* we have received something we think is a frame */
last_frame_time
=
frame_time
;
unsigned
chancount
=
(
max_values
>
SBUS_INPUT_CHANNELS
)
?
SBUS_INPUT_CHANNELS
:
max_values
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment