aboutsummaryrefslogtreecommitdiff
path: root/src/modules/systemlib/pwm_limit/pwm_limit.h
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2013-12-31 14:45:38 +0100
committerLorenz Meier <lm@inf.ethz.ch>2013-12-31 14:45:38 +0100
commit7f14f1f7deb945b7f0ba14c2f49758e9a79d12a3 (patch)
tree85224dcdd724e6a59129cbdbe67a246b432172e2 /src/modules/systemlib/pwm_limit/pwm_limit.h
parentc367959d28134fb6c937af83a3e2dcc25b411eee (diff)
downloadpx4-firmware-7f14f1f7deb945b7f0ba14c2f49758e9a79d12a3.tar.gz
px4-firmware-7f14f1f7deb945b7f0ba14c2f49758e9a79d12a3.tar.bz2
px4-firmware-7f14f1f7deb945b7f0ba14c2f49758e9a79d12a3.zip
Add conversions and mixer tests. Work in progress
Diffstat (limited to 'src/modules/systemlib/pwm_limit/pwm_limit.h')
-rw-r--r--src/modules/systemlib/pwm_limit/pwm_limit.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/modules/systemlib/pwm_limit/pwm_limit.h b/src/modules/systemlib/pwm_limit/pwm_limit.h
index 9974770be..bc8709398 100644
--- a/src/modules/systemlib/pwm_limit/pwm_limit.h
+++ b/src/modules/systemlib/pwm_limit/pwm_limit.h
@@ -46,6 +46,8 @@
#include <stdint.h>
#include <stdbool.h>
+__BEGIN_DECLS
+
/*
* time for the ESCs to initialize
* (this is not actually needed if PWM is sent right after boot)
@@ -56,18 +58,18 @@
*/
#define RAMP_TIME_US 2500000
+enum pwm_limit_state {
+ PWM_LIMIT_STATE_OFF = 0,
+ PWM_LIMIT_STATE_INIT,
+ PWM_LIMIT_STATE_RAMP,
+ PWM_LIMIT_STATE_ON
+};
+
typedef struct {
- enum {
- LIMIT_STATE_OFF = 0,
- LIMIT_STATE_INIT,
- LIMIT_STATE_RAMP,
- LIMIT_STATE_ON
- } state;
+ enum pwm_limit_state state;
uint64_t time_armed;
} pwm_limit_t;
-__BEGIN_DECLS
-
__EXPORT void pwm_limit_init(pwm_limit_t *limit);
__EXPORT void pwm_limit_calc(const bool armed, const unsigned num_channels, const uint16_t *disarmed_pwm, const uint16_t *min_pwm, const uint16_t *max_pwm, float *output, uint16_t *effective_pwm, pwm_limit_t *limit);