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
10b9fde1
Commit
10b9fde1
authored
9 years ago
by
Benoit Landry
Committed by
Lorenz Meier
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
parameters for esc duty cycles
parent
6801a5a0
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/drivers/uart_esc/uart_esc.cpp
+19
-4
19 additions, 4 deletions
src/drivers/uart_esc/uart_esc.cpp
with
19 additions
and
4 deletions
src/drivers/uart_esc/uart_esc.cpp
+
19
−
4
View file @
10b9fde1
...
...
@@ -89,6 +89,10 @@ input_rc_s _rc;
pwm_limit_t
_pwm_limit
;
// esc parameters
uint16_t
_pwm_disarmed
;
uint16_t
_pwm_min
;
uint16_t
_pwm_max
;
MultirotorMixer
*
_mixer
=
nullptr
;
...
...
@@ -414,10 +418,16 @@ void task_main(int argc, char *argv[])
}
const
uint16_t
reverse_mask
=
0
;
// TODO FIXME: these should probably be params
const
uint16_t
disarmed_pwm
[
4
]
=
{
900
,
900
,
900
,
900
};
const
uint16_t
min_pwm
[
4
]
=
{
1230
,
1230
,
1230
,
1230
};
const
uint16_t
max_pwm
[
4
]
=
{
1900
,
1900
,
1900
,
1900
};
uint16_t
disarmed_pwm
[
4
];
uint16_t
min_pwm
[
4
];
uint16_t
max_pwm
[
4
];
for
(
unsigned
int
i
=
0
;
i
<
4
;
i
++
)
{
disarmed_pwm
[
i
]
=
_pwm_disarmed
;
min_pwm
[
i
]
=
_pwm_min
;
max_pwm
[
i
]
=
_pwm_max
;
}
uint16_t
pwm
[
4
];
// TODO FIXME: pre-armed seems broken
...
...
@@ -523,6 +533,11 @@ int uart_esc_main(int argc, char *argv[])
}
}
// gets the parameters for the esc's pwm
param_get
(
param_find
(
"PWM_DISARMED"
),
&
uart_esc
::
_pwm_disarmed
);
param_get
(
param_find
(
"PWM_MIN"
),
&
uart_esc
::
_pwm_min
);
param_get
(
param_find
(
"PWM_MAX"
),
&
uart_esc
::
_pwm_max
);
/*
* Start/load the driver.
*/
...
...
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