From eb885c33bfe990583dbfb180f27376369560a6a4 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Sat, 14 Sep 2019 18:20:36 -0700 Subject: [PATCH] kill (#935) --- firmware/controllers/algo/algo.mk | 7 +- firmware/controllers/algo/map_adjuster.c | 84 ------------------------ firmware/controllers/algo/map_adjuster.h | 19 ------ firmware/controllers/obd2_via_can.c | 19 ------ 4 files changed, 1 insertion(+), 128 deletions(-) delete mode 100644 firmware/controllers/algo/map_adjuster.c delete mode 100644 firmware/controllers/algo/map_adjuster.h delete mode 100644 firmware/controllers/obd2_via_can.c diff --git a/firmware/controllers/algo/algo.mk b/firmware/controllers/algo/algo.mk index 4e043e95f5..5646200dda 100644 --- a/firmware/controllers/algo/algo.mk +++ b/firmware/controllers/algo/algo.mk @@ -1,9 +1,5 @@ +CONTROLLERS_ALGO_SRC = $(PROJECT_DIR)/controllers/algo/nmea.c -CONTROLLERS_ALGO_SRC = $(PROJECT_DIR)/controllers/algo/map_adjuster.c \ - $(PROJECT_DIR)/controllers/algo/nmea.c \ - - - CONTROLLERS_ALGO_SRC_CPP = $(PROJECT_DIR)/controllers/algo/advance_map.cpp \ $(PROJECT_DIR)/controllers/algo/malfunction_central.cpp \ $(GENERATED_ENUMS_DIR)/auto_generated_enums.cpp \ @@ -15,4 +11,3 @@ CONTROLLERS_ALGO_SRC_CPP = $(PROJECT_DIR)/controllers/algo/advance_map.cpp \ $(PROJECT_DIR)/controllers/algo/lcd_menu_tree.cpp \ $(PROJECT_DIR)/controllers/algo/event_registry.cpp \ $(PROJECT_DIR)/controllers/algo/algo.cpp \ - diff --git a/firmware/controllers/algo/map_adjuster.c b/firmware/controllers/algo/map_adjuster.c deleted file mode 100644 index 8beb919b9d..0000000000 --- a/firmware/controllers/algo/map_adjuster.c +++ /dev/null @@ -1,84 +0,0 @@ -/* - * map_adjuster.c - * - * @date Jul 23, 2013 - * @author Andrey Belomutskiy, (c) 2012-2018 - * - * - * This file is part of rusEfi - see http://rusefi.com - * - * rusEfi is free software; you can redistribute it and/or modify it under the terms of - * the GNU General Public License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * rusEfi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with this program. - * If not, see . - */ - -#include -#include "map_adjuster.h" -#include "avg_values.h" - -#define TARGET_MIN_AFR 11 -#define TARGET_MAX_AFR 16 - -#define HOW_MANY_MEASURMENTS_ARE_NEEDED 5 -#define MULT_STEP_DOWN 0.92 - -#if 0 - -static AvgTable adjustments; - -static AvgTable afrs; - -void initMapAdjuster(void) { - avgReset(&afrs); - - avgFill(&adjustments, 1, 1); -} - -static int adjustCell(int i, int j, void (*callback)(int, float, float)) { - int count = afrs.counts[i][j]; - if (count < HOW_MANY_MEASURMENTS_ARE_NEEDED) - return 0; - - float value = avgGetValueByIndexes(&afrs, i, j); - afrs.counts[i][j] = 0; - afrs.values[i][j] = 0; - - if (value < TARGET_MIN_AFR) { - float currentMult = adjustments.values[i][j]; -// printf("adj %d %d. cur=%.2f\r\n", i, j, currentMult); - float newValue = maxF(0.1, MULT_STEP_DOWN * currentMult); - adjustments.values[i][j] = newValue; -// printf("adj %d %d. new=%.2f\r\n", i, j, adjustments.values[i][j]); - if (callback != NULL) - callback(MAX_RPM * i / AVG_TAB_SIZE, 1.0 * MAX_KEY * j / AVG_TAB_SIZE, newValue); - return 1; - } - return 0; -} - -int runMapAdjustments(void (*callback)(int, float, float)) { - int total = 0; - for (int i = 0; i < AVG_TAB_SIZE; i++) { - for (int j = 0; j < AVG_TAB_SIZE; j++) { - total += adjustCell(i, j, callback); - } - } - return total; -} - -void addAfr(int rpm, float key, float afr) { - avgAddValue(&afrs, rpm, key, afr); -} - -float getMultiplier(int rpm, float key) { - return avgGetValue(&adjustments, rpm, key); -} - -#endif /* 0 */ diff --git a/firmware/controllers/algo/map_adjuster.h b/firmware/controllers/algo/map_adjuster.h deleted file mode 100644 index 24371bbd14..0000000000 --- a/firmware/controllers/algo/map_adjuster.h +++ /dev/null @@ -1,19 +0,0 @@ -/** - * map_adjuster.h - * - * Auto-tuning core algorithm - * - * @date Jul 23, 2013 - * @author Andrey Belomutskiy, (c) 2012-2017 - */ - -#ifndef MAP_ADJUSTER_H_ -#define MAP_ADJUSTER_H_ - -void initMapAdjuster(void); -int runMapAdjustments(void (*callback)(int, float, float)); - -void addAfr(int rpm, float key, float afr); -float getMultiplier(int rpm, float key); - -#endif /* MAP_ADJUSTER_H_ */ diff --git a/firmware/controllers/obd2_via_can.c b/firmware/controllers/obd2_via_can.c deleted file mode 100644 index 8bc1d39677..0000000000 --- a/firmware/controllers/obd2_via_can.c +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @file obd2viaCAN.c - * - * - * http://en.wikipedia.org/wiki/OBD-II_PIDs#CAN_.2811-bit.29_Bus_format - * standards.sae.org/j2284/ - * - * OBD-II - * - * @see obd2.cpp - * TODO: remove this dead file? - * - * @date Feb 14, 2014 - * @author Andrey Belomutskiy, (c) 2012-2018 - */ - -#include "global.h" -#include "can_hw.h" -