mirror of
https://github.com/opentx/opentx.git
synced 2025-07-25 01:05:10 +03:00
Overflow on OverrideCHxx functions on ARM boards (range is now
-150:+150)
This commit is contained in:
parent
93d2837dee
commit
99e87050f3
3 changed files with 13 additions and 4 deletions
|
@ -252,8 +252,10 @@ int16_t applyLimits(uint8_t channel, int32_t value)
|
||||||
if (lim->revert) ofs = -ofs; // finally do the reverse.
|
if (lim->revert) ofs = -ofs; // finally do the reverse.
|
||||||
|
|
||||||
#if defined(OVERRIDE_CHANNEL_FUNCTION)
|
#if defined(OVERRIDE_CHANNEL_FUNCTION)
|
||||||
if (safetyCh[channel] != -128) // if safety channel available for channel check
|
if (safetyCh[channel] != OVERRIDE_CHANNEL_UNDEFINED) {
|
||||||
|
// safety channel available for channel check
|
||||||
ofs = calc100toRESX(safetyCh[channel]);
|
ofs = calc100toRESX(safetyCh[channel]);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return ofs;
|
return ofs;
|
||||||
|
|
|
@ -110,7 +110,7 @@ uint8_t heartbeat;
|
||||||
uint8_t stickMode;
|
uint8_t stickMode;
|
||||||
|
|
||||||
#if defined(OVERRIDE_CHANNEL_FUNCTION)
|
#if defined(OVERRIDE_CHANNEL_FUNCTION)
|
||||||
int8_t safetyCh[NUM_CHNOUT];
|
safetych_t safetyCh[NUM_CHNOUT];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
union ReusableBuffer reusableBuffer;
|
union ReusableBuffer reusableBuffer;
|
||||||
|
@ -1871,7 +1871,7 @@ void evalFunctions()
|
||||||
|
|
||||||
#if defined(OVERRIDE_CHANNEL_FUNCTION)
|
#if defined(OVERRIDE_CHANNEL_FUNCTION)
|
||||||
for (uint8_t i=0; i<NUM_CHNOUT; i++) {
|
for (uint8_t i=0; i<NUM_CHNOUT; i++) {
|
||||||
safetyCh[i] = -128; // not defined
|
safetyCh[i] = OVERRIDE_CHANNEL_UNDEFINED;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -863,7 +863,14 @@ struct TimerState {
|
||||||
extern TimerState timersStates[MAX_TIMERS];
|
extern TimerState timersStates[MAX_TIMERS];
|
||||||
|
|
||||||
#if defined(OVERRIDE_CHANNEL_FUNCTION)
|
#if defined(OVERRIDE_CHANNEL_FUNCTION)
|
||||||
extern int8_t safetyCh[NUM_CHNOUT];
|
#if defined(CPUARM)
|
||||||
|
typedef int16_t safetych_t;
|
||||||
|
#define OVERRIDE_CHANNEL_UNDEFINED -4096
|
||||||
|
#else
|
||||||
|
typedef int8_t safetych_t;
|
||||||
|
#define OVERRIDE_CHANNEL_UNDEFINED -128
|
||||||
|
#endif
|
||||||
|
extern safetych_t safetyCh[NUM_CHNOUT];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern uint8_t trimsCheckTimer;
|
extern uint8_t trimsCheckTimer;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue