From 3c3a5851f5611395d0a9f64d71679cabcf740b9a Mon Sep 17 00:00:00 2001 From: bsongis Date: Wed, 2 Apr 2014 16:09:19 +0200 Subject: [PATCH] Another limit was hardcoded in PPM pulses (ARM). We will live another night with 150% limits ... --- radio/src/myeeprom.h | 6 ++++-- radio/src/protocols/ppm_arm.cpp | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/radio/src/myeeprom.h b/radio/src/myeeprom.h index f553144f9..ae67e9fef 100644 --- a/radio/src/myeeprom.h +++ b/radio/src/myeeprom.h @@ -503,7 +503,8 @@ PACK(typedef struct t_ExpoData { #if defined(PCBTARANIS) #define limit_min_max_t int16_t - #define LIMIT_EXT_MAX (125*10) + #define LIMIT_EXT_PERCENT 150 + #define LIMIT_EXT_MAX (LIMIT_EXT_PERCENT*10) #define LIMIT_MAX(lim) (GV_IS_GV_VALUE(lim->max, -LIMIT_EXT_MAX, LIMIT_EXT_MAX) ? GET_GVAR(lim->max, -LIMIT_EXT_MAX, LIMIT_EXT_MAX, s_perout_flight_phase)*10 : lim->max+1000) #define LIMIT_MIN(lim) (GV_IS_GV_VALUE(lim->min, -LIMIT_EXT_MAX, LIMIT_EXT_MAX) ? GET_GVAR(lim->min, -LIMIT_EXT_MAX, LIMIT_EXT_MAX, s_perout_flight_phase)*10 : lim->min-1000) #define LIMIT_OFS(lim) (GV_IS_GV_VALUE(lim->offset, -1000, 1000) ? GET_GVAR(lim->offset, -1000, 1000, s_perout_flight_phase)*10 : lim->offset) @@ -512,7 +513,8 @@ PACK(typedef struct t_ExpoData { #define LIMIT_OFS_RESX(lim) calc1000toRESX(LIMIT_OFS(lim)) #else #define limit_min_max_t int8_t - #define LIMIT_EXT_MAX 125 + #define LIMIT_EXT_PERCENT 125 + #define LIMIT_EXT_MAX LIMIT_EXT_PERCENT #define LIMIT_MAX(lim) (lim->max+100) #define LIMIT_MIN(lim) (lim->min-100) #define LIMIT_OFS(lim) (lim->offset) diff --git a/radio/src/protocols/ppm_arm.cpp b/radio/src/protocols/ppm_arm.cpp index 86e1973fe..b78731f8e 100644 --- a/radio/src/protocols/ppm_arm.cpp +++ b/radio/src/protocols/ppm_arm.cpp @@ -45,7 +45,7 @@ void setupPulsesPPM(unsigned int port) // Don't enable interrupts through here { - int16_t PPM_range = g_model.extendedLimits ? 640 * 2 : 512 * 2; //range of 0.7..1.7msec + int16_t PPM_range = g_model.extendedLimits ? (512*LIMIT_EXT_PERCENT/100) * 2 : 512 * 2; //range of 0.7..1.7msec // Total frame length = 22.5msec // each pulse is 0.7..1.7ms long with a 0.3ms stop tail