warning cleanup (#693)
* Kill annoing warnings about unused vars * Kill annoing signed vs unsigned warnings * Make ALWAYS_INLINE macro realy inlining * Incorrect attribute placement. While correct attribute placement cause ram4 overflow. Move to correct place (to avoid gcc-2018-q4 errors) and comment out. * Silence -Wcast-function-type warnings Cast to intermediate "void *" to lose compiler knowledge about the original type and pass the warning. This is a workaround.
This commit is contained in:
parent
f5a9bbc409
commit
2027977e2c
|
@ -655,6 +655,7 @@ public:
|
||||||
LcdController() : PeriodicController("BenchThread") { }
|
LcdController() : PeriodicController("BenchThread") { }
|
||||||
private:
|
private:
|
||||||
void PeriodicTask(efitime_t nowNt) override {
|
void PeriodicTask(efitime_t nowNt) override {
|
||||||
|
UNUSED(nowNt);
|
||||||
setPeriod(NOT_TOO_OFTEN(10 /* ms */, engineConfiguration->bc.lcdThreadPeriodMs));
|
setPeriod(NOT_TOO_OFTEN(10 /* ms */, engineConfiguration->bc.lcdThreadPeriodMs));
|
||||||
if (engineConfiguration->bc.useLcdScreen) {
|
if (engineConfiguration->bc.useLcdScreen) {
|
||||||
#if EFI_HD44780_LCD
|
#if EFI_HD44780_LCD
|
||||||
|
|
|
@ -62,6 +62,7 @@ public:
|
||||||
AuxPidController() : PeriodicController("AuxPidController") { }
|
AuxPidController() : PeriodicController("AuxPidController") { }
|
||||||
private:
|
private:
|
||||||
void PeriodicTask(efitime_t nowNt) override {
|
void PeriodicTask(efitime_t nowNt) override {
|
||||||
|
UNUSED(nowNt);
|
||||||
setPeriod(NOT_TOO_OFTEN(10 /* ms */, engineConfiguration->auxPid[0].periodMs));
|
setPeriod(NOT_TOO_OFTEN(10 /* ms */, engineConfiguration->auxPid[0].periodMs));
|
||||||
|
|
||||||
if (parametersVersion.isOld(engine->getGlobalConfigurationVersion())) {
|
if (parametersVersion.isOld(engine->getGlobalConfigurationVersion())) {
|
||||||
|
|
|
@ -1493,7 +1493,7 @@ typedef struct {
|
||||||
* At what trigger index should some ignition-related math be executed? This is a performance trick to reduce load on synchronization trigger callback.
|
* At what trigger index should some ignition-related math be executed? This is a performance trick to reduce load on synchronization trigger callback.
|
||||||
* offset 1500
|
* offset 1500
|
||||||
*/
|
*/
|
||||||
int ignMathCalculateAtIndex;
|
unsigned int ignMathCalculateAtIndex;
|
||||||
/**
|
/**
|
||||||
* offset 1504
|
* offset 1504
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -47,6 +47,7 @@ public:
|
||||||
AlternatorController() : PeriodicController("AlternatorController") { }
|
AlternatorController() : PeriodicController("AlternatorController") { }
|
||||||
private:
|
private:
|
||||||
void PeriodicTask(efitime_t nowNt) override {
|
void PeriodicTask(efitime_t nowNt) override {
|
||||||
|
UNUSED(nowNt);
|
||||||
setPeriod(NOT_TOO_OFTEN(10 /* ms */, engineConfiguration->alternatorControl.periodMs));
|
setPeriod(NOT_TOO_OFTEN(10 /* ms */, engineConfiguration->alternatorControl.periodMs));
|
||||||
|
|
||||||
#if ! EFI_UNIT_TEST || defined(__DOXYGEN__)
|
#if ! EFI_UNIT_TEST || defined(__DOXYGEN__)
|
||||||
|
|
|
@ -82,13 +82,13 @@ static LoggingWithStorage logger("ETB");
|
||||||
/**
|
/**
|
||||||
* @brief Pulse-Width Modulation state
|
* @brief Pulse-Width Modulation state
|
||||||
*/
|
*/
|
||||||
static SimplePwm etbPwmUp("etbUp") CCM_OPTIONAL;
|
/*CCM_OPTIONAL*/ static SimplePwm etbPwmUp("etbUp");
|
||||||
static float valueOverride = NAN;
|
static float valueOverride = NAN;
|
||||||
/*
|
/*
|
||||||
static SimplePwm etbPwmDown("etbDown") CCM_OPTIONAL;
|
CCM_OPTIONAL static SimplePwm etbPwmDown("etbDown");
|
||||||
*/
|
*/
|
||||||
static OutputPin outputDirectionOpen CCM_OPTIONAL;
|
/*CCM_OPTIONAL*/ static OutputPin outputDirectionOpen;
|
||||||
static OutputPin outputDirectionClose CCM_OPTIONAL;
|
/*CCM_OPTIONAL*/ static OutputPin outputDirectionClose;
|
||||||
|
|
||||||
EXTERN_ENGINE;
|
EXTERN_ENGINE;
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ static Pid pid(&engineConfiguration->etb);
|
||||||
|
|
||||||
static percent_t currentEtbDuty;
|
static percent_t currentEtbDuty;
|
||||||
|
|
||||||
static bool wasEtbBraking = false;
|
//static bool wasEtbBraking = false;
|
||||||
|
|
||||||
// todo: need to fix PWM so that it supports zero duty cycle
|
// todo: need to fix PWM so that it supports zero duty cycle
|
||||||
#define PERCENT_TO_DUTY(X) (maxF(minI(X, 99.9), 0.1) / 100.0)
|
#define PERCENT_TO_DUTY(X) (maxF(minI(X, 99.9), 0.1) / 100.0)
|
||||||
|
@ -108,6 +108,7 @@ private:
|
||||||
float feedForward = 0;
|
float feedForward = 0;
|
||||||
|
|
||||||
void PeriodicTask(efitime_t nowNt) override {
|
void PeriodicTask(efitime_t nowNt) override {
|
||||||
|
UNUSED(nowNt);
|
||||||
setPeriod(NOT_TOO_OFTEN(10 /* ms */, engineConfiguration->etb.periodMs));
|
setPeriod(NOT_TOO_OFTEN(10 /* ms */, engineConfiguration->etb.periodMs));
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -269,6 +269,7 @@ public:
|
||||||
IdleController() : PeriodicController("IdleValve") { }
|
IdleController() : PeriodicController("IdleValve") { }
|
||||||
private:
|
private:
|
||||||
void PeriodicTask(efitime_t nowNt) override {
|
void PeriodicTask(efitime_t nowNt) override {
|
||||||
|
UNUSED(nowNt);
|
||||||
setPeriod(NOT_TOO_OFTEN(10 /* ms */, engineConfiguration->idleRpmPid.periodMs));
|
setPeriod(NOT_TOO_OFTEN(10 /* ms */, engineConfiguration->idleRpmPid.periodMs));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -220,6 +220,7 @@ public:
|
||||||
BenchController() : PeriodicController("BenchThread") { }
|
BenchController() : PeriodicController("BenchThread") { }
|
||||||
private:
|
private:
|
||||||
void PeriodicTask(efitime_t nowNt) override {
|
void PeriodicTask(efitime_t nowNt) override {
|
||||||
|
UNUSED(nowNt);
|
||||||
setPeriod(NOT_TOO_OFTEN(10 /* ms */, engineConfiguration->auxPid[0].periodMs));
|
setPeriod(NOT_TOO_OFTEN(10 /* ms */, engineConfiguration->auxPid[0].periodMs));
|
||||||
|
|
||||||
// naive inter-thread communication - waiting for a flag
|
// naive inter-thread communication - waiting for a flag
|
||||||
|
|
|
@ -84,6 +84,7 @@ public:
|
||||||
MILController() : PeriodicController("MFIndicator") { }
|
MILController() : PeriodicController("MFIndicator") { }
|
||||||
private:
|
private:
|
||||||
void PeriodicTask(efitime_t nowNt) override {
|
void PeriodicTask(efitime_t nowNt) override {
|
||||||
|
UNUSED(nowNt);
|
||||||
static error_codes_set_s localErrorCopy;
|
static error_codes_set_s localErrorCopy;
|
||||||
|
|
||||||
getErrorCodes(&localErrorCopy);
|
getErrorCodes(&localErrorCopy);
|
||||||
|
|
|
@ -19,6 +19,7 @@ static percent_t mockPedalPosition = MOCK_UNDEFINED;
|
||||||
* this allows unit tests to simulate TPS position
|
* this allows unit tests to simulate TPS position
|
||||||
*/
|
*/
|
||||||
void setMockTpsPosition(percent_t tpsPosition) {
|
void setMockTpsPosition(percent_t tpsPosition) {
|
||||||
|
UNUSED(tpsPosition);
|
||||||
#if !EFI_PROD_CODE
|
#if !EFI_PROD_CODE
|
||||||
mockTps = TPS_TS_CONVERSION * tpsPosition;
|
mockTps = TPS_TS_CONVERSION * tpsPosition;
|
||||||
#endif
|
#endif
|
||||||
|
@ -52,7 +53,7 @@ void saveTpsState(efitimeus_t now, float curValue) {
|
||||||
next->curTime = now;
|
next->curTime = now;
|
||||||
next->curValue = curValue;
|
next->curValue = curValue;
|
||||||
|
|
||||||
int diffSysticks = overflowDiff(now, cur->curTime);
|
//int diffSysticks = overflowDiff(now, cur->curTime);
|
||||||
float diffSeconds = 0;// TODO: do we need this? diffSysticks * 1.0 / CH_FREQUENCY;
|
float diffSeconds = 0;// TODO: do we need this? diffSysticks * 1.0 / CH_FREQUENCY;
|
||||||
next->rateOfChange = (curValue - cur->curValue) / diffSeconds;
|
next->rateOfChange = (curValue - cur->curValue) / diffSeconds;
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,7 @@ static void turnOff(NamedOutputPin *output) {
|
||||||
|
|
||||||
static void auxValveTriggerCallback(trigger_event_e ckpSignalType,
|
static void auxValveTriggerCallback(trigger_event_e ckpSignalType,
|
||||||
uint32_t index DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
uint32_t index DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||||
|
UNUSED(ckpSignalType);
|
||||||
#if EFI_PROD_CODE || EFI_SIMULATOR || defined(__DOXYGEN__)
|
#if EFI_PROD_CODE || EFI_SIMULATOR || defined(__DOXYGEN__)
|
||||||
if (index != SCHEDULING_TRIGGER_INDEX) {
|
if (index != SCHEDULING_TRIGGER_INDEX) {
|
||||||
return;
|
return;
|
||||||
|
@ -79,6 +80,7 @@ static void auxValveTriggerCallback(trigger_event_e ckpSignalType,
|
||||||
}
|
}
|
||||||
|
|
||||||
void initAuxValves(Logging *sharedLogger) {
|
void initAuxValves(Logging *sharedLogger) {
|
||||||
|
UNUSED(sharedLogger);
|
||||||
#if EFI_PROD_CODE || EFI_SIMULATOR || defined(__DOXYGEN__)
|
#if EFI_PROD_CODE || EFI_SIMULATOR || defined(__DOXYGEN__)
|
||||||
if (engineConfiguration->auxValves[0] == GPIO_UNASSIGNED) {
|
if (engineConfiguration->auxValves[0] == GPIO_UNASSIGNED) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -61,7 +61,6 @@ static int gm_tooth_pair(float startAngle, bool isLongShort, TriggerShape* s, in
|
||||||
*/
|
*/
|
||||||
void initGmLS24(TriggerShape *s) {
|
void initGmLS24(TriggerShape *s) {
|
||||||
s->initialize(FOUR_STROKE_CRANK_SENSOR, false);
|
s->initialize(FOUR_STROKE_CRANK_SENSOR, false);
|
||||||
trigger_wheel_e ch = T_PRIMARY;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Okay, here's how this magic works:
|
* Okay, here's how this magic works:
|
||||||
|
|
|
@ -246,7 +246,6 @@ void configureHondaCbr600custom(TriggerShape *s) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void configureHondaAccordShifted(TriggerShape *s) {
|
void configureHondaAccordShifted(TriggerShape *s) {
|
||||||
float w = 720 / 2 / 24;
|
|
||||||
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||||
|
|
||||||
float sb = S24;
|
float sb = S24;
|
||||||
|
@ -278,6 +277,7 @@ void configureHondaAccordShifted(TriggerShape *s) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void configureOnePlus16(TriggerShape *s, operation_mode_e operationMode) {
|
void configureOnePlus16(TriggerShape *s, operation_mode_e operationMode) {
|
||||||
|
UNUSED(operationMode);
|
||||||
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||||
|
|
||||||
int totalTeethCount = 16;
|
int totalTeethCount = 16;
|
||||||
|
|
|
@ -37,8 +37,6 @@ void initializeMitsubishi4g18(TriggerShape *s) {
|
||||||
|
|
||||||
s->setTriggerSynchronizationGap(1.6666);
|
s->setTriggerSynchronizationGap(1.6666);
|
||||||
|
|
||||||
int secondaryWidth = 70;
|
|
||||||
|
|
||||||
s->addEvent720(106.77999999999997, T_PRIMARY, TV_FALL);
|
s->addEvent720(106.77999999999997, T_PRIMARY, TV_FALL);
|
||||||
s->addEvent720(120.09999999999998, T_SECONDARY, TV_RISE);
|
s->addEvent720(120.09999999999998, T_SECONDARY, TV_RISE);
|
||||||
s->addEvent720(188.0775, T_SECONDARY, TV_FALL);
|
s->addEvent720(188.0775, T_SECONDARY, TV_FALL);
|
||||||
|
|
|
@ -163,6 +163,7 @@ extern bool printTriggerDebug;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void TriggerShape::calculateExpectedEventCounts(bool useOnlyRisingEdgeForTrigger) {
|
void TriggerShape::calculateExpectedEventCounts(bool useOnlyRisingEdgeForTrigger) {
|
||||||
|
UNUSED(useOnlyRisingEdgeForTrigger);
|
||||||
// todo: move the following logic from below here
|
// todo: move the following logic from below here
|
||||||
// if (!useOnlyRisingEdgeForTrigger || stateParam == TV_RISE) {
|
// if (!useOnlyRisingEdgeForTrigger || stateParam == TV_RISE) {
|
||||||
// expectedEventCount[channelIndex]++;
|
// expectedEventCount[channelIndex]++;
|
||||||
|
|
|
@ -206,7 +206,7 @@ public:
|
||||||
* but name is supposed to hint at the fact that decoders should not be assigning to it
|
* but name is supposed to hint at the fact that decoders should not be assigning to it
|
||||||
* Please use "getTriggerSize()" macro or "getSize()" method to read this value
|
* Please use "getTriggerSize()" macro or "getSize()" method to read this value
|
||||||
*/
|
*/
|
||||||
int privateTriggerDefinitionSize;
|
unsigned int privateTriggerDefinitionSize;
|
||||||
|
|
||||||
bool useOnlyRisingEdgeForTriggerTemp;
|
bool useOnlyRisingEdgeForTriggerTemp;
|
||||||
|
|
||||||
|
|
|
@ -47,8 +47,6 @@ void initializeSkippedToothTriggerShapeExt(TriggerShape *s, int totalTeethCount,
|
||||||
|
|
||||||
|
|
||||||
void configureOnePlusOne(TriggerShape *s, operation_mode_e operationMode) {
|
void configureOnePlusOne(TriggerShape *s, operation_mode_e operationMode) {
|
||||||
float engineCycle = getEngineCycle(operationMode);
|
|
||||||
|
|
||||||
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||||
|
|
||||||
s->addEvent720(180, T_PRIMARY, TV_RISE);
|
s->addEvent720(180, T_PRIMARY, TV_RISE);
|
||||||
|
@ -62,6 +60,7 @@ void configureOnePlusOne(TriggerShape *s, operation_mode_e operationMode) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void configureOnePlus60_2(TriggerShape *s, operation_mode_e operationMode) {
|
void configureOnePlus60_2(TriggerShape *s, operation_mode_e operationMode) {
|
||||||
|
UNUSED(operationMode);
|
||||||
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||||
|
|
||||||
int totalTeethCount = 60;
|
int totalTeethCount = 60;
|
||||||
|
@ -80,6 +79,7 @@ void configureOnePlus60_2(TriggerShape *s, operation_mode_e operationMode) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void configure3_1_cam(TriggerShape *s, operation_mode_e operationMode) {
|
void configure3_1_cam(TriggerShape *s, operation_mode_e operationMode) {
|
||||||
|
UNUSED(operationMode);
|
||||||
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -136,7 +136,7 @@ void calculateTriggerSynchPoint(TriggerShape *shape, TriggerState *state DECLARE
|
||||||
shape->riseOnlyIndexes[0] = 0;
|
shape->riseOnlyIndexes[0] = 0;
|
||||||
} else {
|
} else {
|
||||||
assertAngleRange(shape->triggerShapeSynchPointIndex, "triggerShapeSynchPointIndex", CUSTOM_ERR_6552);
|
assertAngleRange(shape->triggerShapeSynchPointIndex, "triggerShapeSynchPointIndex", CUSTOM_ERR_6552);
|
||||||
int triggerDefinitionCoordinate = (shape->triggerShapeSynchPointIndex + eventIndex) % engine->engineCycleEventCount;
|
unsigned int triggerDefinitionCoordinate = (shape->triggerShapeSynchPointIndex + eventIndex) % engine->engineCycleEventCount;
|
||||||
efiAssertVoid(CUSTOM_ERR_6595, engine->engineCycleEventCount != 0, "zero engineCycleEventCount");
|
efiAssertVoid(CUSTOM_ERR_6595, engine->engineCycleEventCount != 0, "zero engineCycleEventCount");
|
||||||
int triggerDefinitionIndex = triggerDefinitionCoordinate >= shape->privateTriggerDefinitionSize ? triggerDefinitionCoordinate - shape->privateTriggerDefinitionSize : triggerDefinitionCoordinate;
|
int triggerDefinitionIndex = triggerDefinitionCoordinate >= shape->privateTriggerDefinitionSize ? triggerDefinitionCoordinate - shape->privateTriggerDefinitionSize : triggerDefinitionCoordinate;
|
||||||
float angle = shape->getAngle(triggerDefinitionCoordinate) - firstAngle;
|
float angle = shape->getAngle(triggerDefinitionCoordinate) - firstAngle;
|
||||||
|
@ -536,7 +536,7 @@ void TriggerState::decodeTriggerEvent(trigger_event_e const signal, efitime_t no
|
||||||
getTriggerSize());
|
getTriggerSize());
|
||||||
}
|
}
|
||||||
#endif /* EFI_UNIT_TEST */
|
#endif /* EFI_UNIT_TEST */
|
||||||
int endOfCycleIndex = getTriggerSize() - (CONFIG(useOnlyRisingEdgeForTrigger) ? 2 : 1);
|
unsigned int endOfCycleIndex = getTriggerSize() - (CONFIG(useOnlyRisingEdgeForTrigger) ? 2 : 1);
|
||||||
|
|
||||||
|
|
||||||
isSynchronizationPoint = !shaft_is_synchronized || (currentCycle.current_index >= endOfCycleIndex);
|
isSynchronizationPoint = !shaft_is_synchronized || (currentCycle.current_index >= endOfCycleIndex);
|
||||||
|
@ -632,6 +632,7 @@ static void onFindIndexCallback(TriggerState *state) {
|
||||||
*/
|
*/
|
||||||
uint32_t findTriggerZeroEventIndex(TriggerState *state, TriggerShape * shape,
|
uint32_t findTriggerZeroEventIndex(TriggerState *state, TriggerShape * shape,
|
||||||
trigger_config_s const*triggerConfig DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
trigger_config_s const*triggerConfig DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||||
|
UNUSED(triggerConfig);
|
||||||
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
||||||
efiAssert(CUSTOM_ERR_ASSERT, getRemainingStack(chThdGetSelfX()) > 128, "findPos", -1);
|
efiAssert(CUSTOM_ERR_ASSERT, getRemainingStack(chThdGetSelfX()) > 128, "findPos", -1);
|
||||||
#endif
|
#endif
|
||||||
|
@ -685,6 +686,7 @@ efitime_t TriggerState::getStartOfRevolutionIndex() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void TriggerState::runtimeStatistics(efitime_t nowNt DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
void TriggerState::runtimeStatistics(efitime_t nowNt DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||||
|
UNUSED(nowNt);
|
||||||
// empty base implementation
|
// empty base implementation
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ extern "C"
|
||||||
#if defined __GNUC__
|
#if defined __GNUC__
|
||||||
// GCC
|
// GCC
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#define ALWAYS_INLINE __attribute__((always_inline))
|
#define ALWAYS_INLINE __attribute__((always_inline)) inline
|
||||||
#else
|
#else
|
||||||
// IAR
|
// IAR
|
||||||
typedef unsigned int time_t;
|
typedef unsigned int time_t;
|
||||||
|
|
|
@ -62,7 +62,7 @@ void cdmIonInit(void) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
enableExti(CONFIGB(cdmInputPin), PAL_EVENT_MODE_RISING_EDGE, (palcallback_t)extIonCallback);
|
enableExti(CONFIGB(cdmInputPin), PAL_EVENT_MODE_RISING_EDGE, (palcallback_t)(void *)extIonCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* EFI_CDM_INTEGRATION */
|
#endif /* EFI_CDM_INTEGRATION */
|
||||||
|
|
|
@ -104,11 +104,11 @@ void initJoystick(Logging *shared) {
|
||||||
return;
|
return;
|
||||||
sharedLogger = shared;
|
sharedLogger = shared;
|
||||||
|
|
||||||
enableExti(CONFIGB(joystickCenterPin), PAL_EVENT_MODE_RISING_EDGE, (palcallback_t)extCallback);
|
enableExti(CONFIGB(joystickCenterPin), PAL_EVENT_MODE_RISING_EDGE, (palcallback_t)(void *)extCallback);
|
||||||
enableExti(CONFIGB(joystickAPin), PAL_EVENT_MODE_RISING_EDGE, (palcallback_t)extCallback);
|
enableExti(CONFIGB(joystickAPin), PAL_EVENT_MODE_RISING_EDGE, (palcallback_t)(void *)extCallback);
|
||||||
// not used so far applyPin(CONFIGB(joystickBPin));
|
// not used so far applyPin(CONFIGB(joystickBPin));
|
||||||
// not used so far applyPin(CONFIGB(joystickCPin));
|
// not used so far applyPin(CONFIGB(joystickCPin));
|
||||||
enableExti(CONFIGB(joystickDPin), PAL_EVENT_MODE_RISING_EDGE, (palcallback_t)extCallback);
|
enableExti(CONFIGB(joystickDPin), PAL_EVENT_MODE_RISING_EDGE, (palcallback_t)(void *)extCallback);
|
||||||
|
|
||||||
efiSetPadMode("joy center", CONFIGB(joystickCenterPin), PAL_MODE_INPUT_PULLUP);
|
efiSetPadMode("joy center", CONFIGB(joystickCenterPin), PAL_MODE_INPUT_PULLUP);
|
||||||
efiSetPadMode("joy A", CONFIGB(joystickAPin), PAL_MODE_INPUT_PULLUP);
|
efiSetPadMode("joy A", CONFIGB(joystickAPin), PAL_MODE_INPUT_PULLUP);
|
||||||
|
|
|
@ -41,7 +41,7 @@ class cyclic_buffer
|
||||||
T sum(int length) const;
|
T sum(int length) const;
|
||||||
T maxValue(int length) const;
|
T maxValue(int length) const;
|
||||||
T minValue(int length) const;
|
T minValue(int length) const;
|
||||||
void setSize(int size);
|
void setSize(unsigned int size);
|
||||||
bool contains(T value) const;
|
bool contains(T value) const;
|
||||||
int getSize() const;
|
int getSize() const;
|
||||||
int getCount() const;
|
int getCount() const;
|
||||||
|
@ -125,7 +125,7 @@ bool cyclic_buffer<T, maxSize>::contains(T value) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T, size_t maxSize>
|
template<typename T, size_t maxSize>
|
||||||
void cyclic_buffer<T, maxSize>::setSize(int size) {
|
void cyclic_buffer<T, maxSize>::setSize(unsigned int size) {
|
||||||
clear();
|
clear();
|
||||||
this->size = size < maxSize ? size : maxSize;
|
this->size = size < maxSize ? size : maxSize;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue