mirror of
https://github.com/opentx/opentx.git
synced 2025-07-25 01:05:10 +03:00
Renamed lswReset() to logicalSwitchesReset()
Added PACKED to logical switches data structures
This commit is contained in:
parent
8ec706ad08
commit
1491d3b236
4 changed files with 8 additions and 8 deletions
|
@ -53,7 +53,7 @@ void doMixerCalculations();
|
||||||
memset(act, 0, sizeof(act)); \
|
memset(act, 0, sizeof(act)); \
|
||||||
memset(swOn, 0, sizeof(swOn)); \
|
memset(swOn, 0, sizeof(swOn)); \
|
||||||
int32_t lastAct = 0; lastAct = lastAct; /* to avoid a warning */ \
|
int32_t lastAct = 0; lastAct = lastAct; /* to avoid a warning */ \
|
||||||
lswReset();
|
logicalSwitchesReset();
|
||||||
|
|
||||||
uint16_t anaInValues[NUM_STICKS+NUM_POTS] = { 0 };
|
uint16_t anaInValues[NUM_STICKS+NUM_POTS] = { 0 };
|
||||||
uint16_t anaIn(uint8_t chan)
|
uint16_t anaIn(uint8_t chan)
|
||||||
|
|
|
@ -1519,7 +1519,7 @@ void flightReset()
|
||||||
#if defined(FRSKY)
|
#if defined(FRSKY)
|
||||||
telemetryReset();
|
telemetryReset();
|
||||||
#endif
|
#endif
|
||||||
lswReset();
|
logicalSwitchesReset();
|
||||||
|
|
||||||
s_mixer_first_run_done = false;
|
s_mixer_first_run_done = false;
|
||||||
|
|
||||||
|
|
|
@ -694,7 +694,7 @@ NOINLINE void per10ms();
|
||||||
getvalue_t getValue(uint8_t i);
|
getvalue_t getValue(uint8_t i);
|
||||||
bool getSwitch(int8_t swtch);
|
bool getSwitch(int8_t swtch);
|
||||||
void lswTimerTick();
|
void lswTimerTick();
|
||||||
void lswReset();
|
void logicalSwitchesReset();
|
||||||
void evalLogicalSwitches(uint8_t mode);
|
void evalLogicalSwitches(uint8_t mode);
|
||||||
void copyLswState(uint8_t oldPhase, uint8_t newPhase);
|
void copyLswState(uint8_t oldPhase, uint8_t newPhase);
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
|
|
||||||
#define CS_LAST_VALUE_INIT -32768
|
#define CS_LAST_VALUE_INIT -32768
|
||||||
|
|
||||||
typedef struct {
|
PACK(typedef struct {
|
||||||
uint8_t state:1;
|
uint8_t state:1;
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
uint8_t internalState:1;
|
uint8_t internalState:1;
|
||||||
|
@ -46,11 +46,11 @@ typedef struct {
|
||||||
uint32_t duration;
|
uint32_t duration;
|
||||||
#endif
|
#endif
|
||||||
int16_t lastValue;
|
int16_t lastValue;
|
||||||
} lsw_struct;
|
}) lsw_struct;
|
||||||
|
|
||||||
typedef struct {
|
PACK(typedef struct {
|
||||||
lsw_struct ls[NUM_LOGICAL_SWITCH];
|
lsw_struct ls[NUM_LOGICAL_SWITCH];
|
||||||
} lsw_array;
|
}) lsw_array;
|
||||||
|
|
||||||
lsw_array lswFm[MAX_FLIGHT_MODES];
|
lsw_array lswFm[MAX_FLIGHT_MODES];
|
||||||
|
|
||||||
|
@ -702,7 +702,7 @@ int16_t lswTimerValue(delayval_t val)
|
||||||
return (val < -109 ? 129+val : (val < 7 ? (113+val)*5 : (53+val)*10));
|
return (val < -109 ? 129+val : (val < 7 ? (113+val)*5 : (53+val)*10));
|
||||||
}
|
}
|
||||||
|
|
||||||
void lswReset() {
|
void logicalSwitchesReset() {
|
||||||
for (uint8_t fm=0; fm<MAX_FLIGHT_MODES; fm++) {
|
for (uint8_t fm=0; fm<MAX_FLIGHT_MODES; fm++) {
|
||||||
lsw_array * lsa = &lswFm[fm];
|
lsw_array * lsa = &lswFm[fm];
|
||||||
for (uint8_t i=0; i<NUM_LOGICAL_SWITCH; i++) {
|
for (uint8_t i=0; i<NUM_LOGICAL_SWITCH; i++) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue