mirror of https://github.com/FOME-Tech/fome-fw.git
compile warnings: signed vs unsigned and unused (#4713)
This commit is contained in:
parent
d897316f1b
commit
cc9b1517ac
|
@ -24,7 +24,6 @@ static Pid alternatorPid(&persistentState.persistentConfiguration.engineConfigur
|
||||||
|
|
||||||
static percent_t currentAltDuty;
|
static percent_t currentAltDuty;
|
||||||
|
|
||||||
static bool currentPlainOnOffState = false;
|
|
||||||
static bool shouldResetPid = false;
|
static bool shouldResetPid = false;
|
||||||
|
|
||||||
static void pidReset() {
|
static void pidReset() {
|
||||||
|
|
|
@ -15,7 +15,7 @@ static void setDefaultAlternatorParameters() {
|
||||||
|
|
||||||
/* Cylinder to bank mapping */
|
/* Cylinder to bank mapping */
|
||||||
void setLeftRightBanksNeedBetterName() {
|
void setLeftRightBanksNeedBetterName() {
|
||||||
for (int i = 0;i<engineConfiguration->specs.cylindersCount;i++) {
|
for (size_t i = 0; i < engineConfiguration->specs.cylindersCount; i++) {
|
||||||
engineConfiguration->cylinderBankSelect[i] = i % 2;
|
engineConfiguration->cylinderBankSelect[i] = i % 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#include "odometer.h"
|
#include "odometer.h"
|
||||||
|
|
||||||
|
|
||||||
static odometer_state odometerCopies[2];
|
//static odometer_state odometerCopies[2];
|
||||||
|
|
||||||
void setCrc(odometer_state *state) {
|
void setCrc(odometer_state *state) {
|
||||||
state->crc = crc32(state, 4);
|
state->crc = crc32(state, 4);
|
||||||
|
|
|
@ -39,8 +39,6 @@ int isIgnitionTimingError(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void fireSparkBySettingPinLow(IgnitionEvent *event, IgnitionOutputPin *output) {
|
static void fireSparkBySettingPinLow(IgnitionEvent *event, IgnitionOutputPin *output) {
|
||||||
efitick_t nowNt = getTimeNowNt();
|
|
||||||
|
|
||||||
#if SPARK_EXTREME_LOGGING
|
#if SPARK_EXTREME_LOGGING
|
||||||
efiPrintf("spark goes low %d %s %d current=%d cnt=%d id=%d", getRevolutionCounter(), output->name, (int)getTimeNowUs(),
|
efiPrintf("spark goes low %d %s %d current=%d cnt=%d id=%d", getRevolutionCounter(), output->name, (int)getTimeNowUs(),
|
||||||
output->currentLogicValue, output->outOfOrder, event->sparkId);
|
output->currentLogicValue, output->outOfOrder, event->sparkId);
|
||||||
|
|
|
@ -12,7 +12,7 @@ CanFilter* getFilterForId(size_t busIndex, int Id) {
|
||||||
auto& filter = filters[i];
|
auto& filter = filters[i];
|
||||||
|
|
||||||
if (filter.accept(Id)) {
|
if (filter.accept(Id)) {
|
||||||
if (filter.Bus == ANY_BUS || filter.Bus == busIndex) {
|
if (filter.Bus == ANY_BUS || filter.Bus == (int)busIndex) {
|
||||||
return &filter;
|
return &filter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ bool AemXSeriesWideband::acceptFrame(const CANRxFrame& frame) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void AemXSeriesWideband::decodeFrame(const CANRxFrame& frame, efitick_t nowNt) {
|
void AemXSeriesWideband::decodeFrame(const CANRxFrame& frame, efitick_t nowNt) {
|
||||||
int32_t id = CAN_ID(frame);
|
uint32_t id = CAN_ID(frame);
|
||||||
|
|
||||||
// accept frame has already guaranteed that this message belongs to us
|
// accept frame has already guaranteed that this message belongs to us
|
||||||
// We just have to check if it's AEM or rusEFI
|
// We just have to check if it's AEM or rusEFI
|
||||||
|
|
|
@ -172,7 +172,7 @@ void SensorChecker::onSlowCallback() {
|
||||||
// only bother checking these if we have GPIO chips actually capable of reporting an error
|
// only bother checking these if we have GPIO chips actually capable of reporting an error
|
||||||
#if BOARD_EXT_GPIOCHIPS > 0 && EFI_PROD_CODE
|
#if BOARD_EXT_GPIOCHIPS > 0 && EFI_PROD_CODE
|
||||||
// Check injectors
|
// Check injectors
|
||||||
for (int i = 0; i < efi::size(enginePins.injectors); i++) {
|
for (size_t i = 0; i < efi::size(enginePins.injectors); i++) {
|
||||||
InjectorOutputPin& pin = enginePins.injectors[i];
|
InjectorOutputPin& pin = enginePins.injectors[i];
|
||||||
|
|
||||||
// Skip not-configured pins
|
// Skip not-configured pins
|
||||||
|
@ -191,7 +191,7 @@ void SensorChecker::onSlowCallback() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check ignition
|
// Check ignition
|
||||||
for (int i = 0; i < efi::size(enginePins.injectors); i++) {
|
for (size_t i = 0; i < efi::size(enginePins.injectors); i++) {
|
||||||
IgnitionOutputPin& pin = enginePins.coils[i];
|
IgnitionOutputPin& pin = enginePins.coils[i];
|
||||||
|
|
||||||
// Skip not-configured pins
|
// Skip not-configured pins
|
||||||
|
|
|
@ -185,7 +185,7 @@ float AngleBasedEventOld::getAngleFromNow(float /*currentPhase*/) const {
|
||||||
return position.angleOffsetFromTriggerEvent;
|
return position.angleOffsetFromTriggerEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AngleBasedEventNew::shouldSchedule(uint32_t trgEventIndex, float currentPhase, float nextPhase) const {
|
bool AngleBasedEventNew::shouldSchedule(uint32_t /*trgEventIndex*/, float currentPhase, float nextPhase) const {
|
||||||
return isPhaseInRange(this->enginePhase, currentPhase, nextPhase);
|
return isPhaseInRange(this->enginePhase, currentPhase, nextPhase);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
void TransmissionControllerBase::init() {
|
void TransmissionControllerBase::init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void TransmissionControllerBase::update(gear_e gear) {
|
void TransmissionControllerBase::update(gear_e /*gear*/) {
|
||||||
postState();
|
postState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -130,7 +130,7 @@ void initializeVvt3A92(TriggerWaveform *s) {
|
||||||
s->setSecondTriggerSynchronizationGap(0.11); // redundancy
|
s->setSecondTriggerSynchronizationGap(0.11); // redundancy
|
||||||
}
|
}
|
||||||
|
|
||||||
void initializeVvt6G75(TriggerWaveform *s) {
|
void initializeVvt6G75(TriggerWaveform /* *s */) {
|
||||||
// s->shapeWithoutTdc = true;
|
// s->shapeWithoutTdc = true;
|
||||||
// s->isSynchronizationNeeded = false;
|
// s->isSynchronizationNeeded = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -279,8 +279,6 @@ void hwHandleVvtCamSignal(TriggerValue front, efitick_t nowNt, int index) {
|
||||||
#endif /* EFI_TOOTH_LOGGER */
|
#endif /* EFI_TOOTH_LOGGER */
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto& vvtShape = tc->vvtShape[camIndex];
|
|
||||||
|
|
||||||
bool isImportantFront = (engineConfiguration->vvtCamSensorUseRise ^ (front == TriggerValue::FALL));
|
bool isImportantFront = (engineConfiguration->vvtCamSensorUseRise ^ (front == TriggerValue::FALL));
|
||||||
bool isVvtWithRealDecoder = vvtWithRealDecoder(engineConfiguration->vvtMode[camIndex]);
|
bool isVvtWithRealDecoder = vvtWithRealDecoder(engineConfiguration->vvtMode[camIndex]);
|
||||||
if (!isVvtWithRealDecoder && !isImportantFront) {
|
if (!isVvtWithRealDecoder && !isImportantFront) {
|
||||||
|
|
|
@ -241,7 +241,7 @@ void PrimaryTriggerDecoder::movePreSynchTimestamps() {
|
||||||
// at appropriate locations
|
// at appropriate locations
|
||||||
auto triggerSize = getTriggerCentral()->triggerShape.getLength();
|
auto triggerSize = getTriggerCentral()->triggerShape.getLength();
|
||||||
|
|
||||||
int eventsToCopy = minI(spinningEventIndex, triggerSize);
|
size_t eventsToCopy = minI(spinningEventIndex, triggerSize);
|
||||||
|
|
||||||
size_t firstSrc;
|
size_t firstSrc;
|
||||||
size_t firstDst;
|
size_t firstDst;
|
||||||
|
@ -649,9 +649,6 @@ expected<TriggerDecodeResult> TriggerDecoderBase::decodeTriggerEvent(
|
||||||
if (verbose || (someSortOfTriggerError() && !silentTriggerError)) {
|
if (verbose || (someSortOfTriggerError() && !silentTriggerError)) {
|
||||||
const char * prefix = verbose ? "[vrb]" : "[err]";
|
const char * prefix = verbose ? "[vrb]" : "[err]";
|
||||||
|
|
||||||
int rpm = Sensor::getOrZero(SensorType::Rpm);
|
|
||||||
floatms_t engineCycleDuration = getEngineCycleDuration(rpm);
|
|
||||||
|
|
||||||
for (int i = 0;i<triggerShape.gapTrackingLength;i++) {
|
for (int i = 0;i<triggerShape.gapTrackingLength;i++) {
|
||||||
float ratioFrom = triggerShape.syncronizationRatioFrom[i];
|
float ratioFrom = triggerShape.syncronizationRatioFrom[i];
|
||||||
if (cisnan(ratioFrom)) {
|
if (cisnan(ratioFrom)) {
|
||||||
|
|
|
@ -208,7 +208,7 @@ public:
|
||||||
*/
|
*/
|
||||||
uint32_t timeOfLastEvent[PWM_PHASE_MAX_COUNT];
|
uint32_t timeOfLastEvent[PWM_PHASE_MAX_COUNT];
|
||||||
|
|
||||||
int spinningEventIndex = 0;
|
size_t spinningEventIndex = 0;
|
||||||
|
|
||||||
// we might need up to one full trigger cycle of events - which on 60-2 means storage for ~120
|
// we might need up to one full trigger cycle of events - which on 60-2 means storage for ~120
|
||||||
// todo: change the implementation to reuse 'timeOfLastEvent'
|
// todo: change the implementation to reuse 'timeOfLastEvent'
|
||||||
|
|
|
@ -114,7 +114,7 @@ void WaveReader::onFallEvent() {
|
||||||
periodEventTimeUs = nowUs;
|
periodEventTimeUs = nowUs;
|
||||||
}
|
}
|
||||||
|
|
||||||
void logicAnalyzerCallback(void* arg, efitick_t stamp) {
|
void logicAnalyzerCallback(void* arg, efitick_t /*stamp*/) {
|
||||||
WaveReader* instance = reinterpret_cast<WaveReader*>(arg);
|
WaveReader* instance = reinterpret_cast<WaveReader*>(arg);
|
||||||
|
|
||||||
bool rise = palReadLine(instance->line) == PAL_HIGH;
|
bool rise = palReadLine(instance->line) == PAL_HIGH;
|
||||||
|
@ -126,7 +126,7 @@ void logicAnalyzerCallback(void* arg, efitick_t stamp) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void initWave(int index) {
|
static void initWave(size_t index) {
|
||||||
brain_pin_e brainPin = engineConfiguration->logicAnalyzerPins[index];
|
brain_pin_e brainPin = engineConfiguration->logicAnalyzerPins[index];
|
||||||
|
|
||||||
efiAssertVoid(CUSTOM_ERR_6655, index < efi::size(readers), "too many ICUs");
|
efiAssertVoid(CUSTOM_ERR_6655, index < efi::size(readers), "too many ICUs");
|
||||||
|
@ -242,7 +242,7 @@ void initWaveAnalyzer() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void startLogicAnalyzerPins() {
|
void startLogicAnalyzerPins() {
|
||||||
for (int index = 0; index < LOGIC_ANALYZER_CHANNEL_COUNT; index++) {
|
for (size_t index = 0; index < LOGIC_ANALYZER_CHANNEL_COUNT; index++) {
|
||||||
initWave(index);
|
initWave(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -256,7 +256,7 @@ static void endIntegration(HIP9011 *hip) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void onStartKnockSampling(uint8_t cylinderIndex, float samplingTimeSeconds, uint8_t channelIdx) {
|
void onStartKnockSampling(uint8_t /*cylinderIndex*/, float /*samplingTimeSeconds*/, uint8_t /*channelIdx*/) {
|
||||||
/* TODO: @dron0gus: not sure if we need the expectedCylinderNumber logic at all
|
/* TODO: @dron0gus: not sure if we need the expectedCylinderNumber logic at all
|
||||||
|
|
||||||
Something like this might be right:
|
Something like this might be right:
|
||||||
|
|
Loading…
Reference in New Issue