From 53fb1b7779d59667143a2da96e7158ab704ec0c2 Mon Sep 17 00:00:00 2001 From: rusEfi Date: Wed, 17 Sep 2014 12:02:56 -0500 Subject: [PATCH] auto-sync --- .../controllers/algo/engine_configuration.cpp | 4 ++++ .../controllers/algo/engine_configuration.h | 4 +++- firmware/hw_layer/max31855.c | 24 +++++++++++++++++++ firmware/util/cli_registry.c | 20 ++++++++-------- 4 files changed, 41 insertions(+), 11 deletions(-) diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index 96ea11a271..1555a043f3 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -272,6 +272,10 @@ void setDefaultConfiguration(engine_configuration_s *engineConfiguration, board_ */ boardConfiguration->triggerSimulatorFrequency = 1200; + for (int i = 0; i < MAX31855_CS_COUNT; i++) { + boardConfiguration->max31855_cs[i] = GPIO_NONE; + } + boardConfiguration->idleValvePin = GPIOE_2; boardConfiguration->idleValvePinMode = OM_DEFAULT; diff --git a/firmware/controllers/algo/engine_configuration.h b/firmware/controllers/algo/engine_configuration.h index a64771d956..9cd7b56200 100644 --- a/firmware/controllers/algo/engine_configuration.h +++ b/firmware/controllers/algo/engine_configuration.h @@ -201,7 +201,9 @@ typedef struct { pin_output_mode_e mainRelayPinMode; - int unusedbs[100]; + brain_pin_e max31855_cs[MAX31855_CS_COUNT]; + + int unusedbs[92]; } board_configuration_s; diff --git a/firmware/hw_layer/max31855.c b/firmware/hw_layer/max31855.c index dfb13bb4b6..44072f0536 100644 --- a/firmware/hw_layer/max31855.c +++ b/firmware/hw_layer/max31855.c @@ -10,7 +10,31 @@ */ #include "max31855.h" +#include "pin_repository.h" + +static Logging logger; + +static void showEgtInfo(void) { + for (int i = 0; i < MAX31855_CS_COUNT; i++) { +// if (boardConfiguration->max31855_cs[i] != GPIO_NONE) { +// scheduleMsg(&logger, "%d ETG @ %s", i, hwPortname(boardConfiguration->max31855_cs[i])); + + +// } + + } +} void initMax31855(board_configuration_s *boardConfiguration) { + initLogging(&logger, "EGT"); + + addConsoleAction("egtinfo", showEgtInfo); + + for (int i = 0; i < MAX31855_CS_COUNT; i++) { + if (boardConfiguration->max31855_cs[i] != GPIO_NONE) { + + } + + } } diff --git a/firmware/util/cli_registry.c b/firmware/util/cli_registry.c index b237580929..5a1f0ee2b3 100644 --- a/firmware/util/cli_registry.c +++ b/firmware/util/cli_registry.c @@ -37,7 +37,7 @@ void resetConsoleActions(void) { consoleActionCount = 0; } -static void doAddAction(const char *token, int type, Void callback) { +static void doAddAction(const char *token, int type, Void callback, void *param) { efiAssertVoid(consoleActionCount < CONSOLE_MAX_ACTIONS, "Too many console actions"); TokenCallback *current = &consoleActions[consoleActionCount++]; current->token = token; @@ -49,45 +49,45 @@ static void doAddAction(const char *token, int type, Void callback) { * @brief Register console action without parameters */ void addConsoleAction(const char *token, Void callback) { - doAddAction(token, NO_PARAMETER, callback); + doAddAction(token, NO_PARAMETER, callback, NULL); } /** * @brief Register a console command with one Integer parameter */ void addConsoleActionI(const char *token, VoidInt callback) { - doAddAction(token, ONE_PARAMETER, (Void) callback); + doAddAction(token, ONE_PARAMETER, (Void) callback, NULL); } /** * @brief Register a console command with two Integer parameters */ void addConsoleActionII(const char *token, VoidIntInt callback) { - doAddAction(token, TWO_INTS_PARAMETER, (Void) callback); + doAddAction(token, TWO_INTS_PARAMETER, (Void) callback, NULL); } void addConsoleActionS(const char *token, VoidCharPtr callback) { - doAddAction(token, STRING_PARAMETER, (Void) callback); + doAddAction(token, STRING_PARAMETER, (Void) callback, NULL); } void addConsoleActionSS(const char *token, VoidCharPtrCharPtr callback) { - doAddAction(token, STRING2_PARAMETER, (Void) callback); + doAddAction(token, STRING2_PARAMETER, (Void) callback, NULL); } void addConsoleActionSSS(const char *token, VoidCharPtrCharPtrCharPtr callback) { - doAddAction(token, STRING3_PARAMETER, (Void) callback); + doAddAction(token, STRING3_PARAMETER, (Void) callback, NULL); } void addConsoleActionSSSSS(const char *token, VoidCharPtrCharPtrCharPtrCharPtrCharPtr callback) { - doAddAction(token, STRING5_PARAMETER, (Void) callback); + doAddAction(token, STRING5_PARAMETER, (Void) callback, NULL); } void addConsoleActionF(const char *token, VoidFloat callback) { - doAddAction(token, FLOAT_PARAMETER, (Void) callback); + doAddAction(token, FLOAT_PARAMETER, (Void) callback, NULL); } void addConsoleActionFF(const char *token, VoidFloatFloat callback) { - doAddAction(token, FLOAT_FLOAT_PARAMETER, (Void) callback); + doAddAction(token, FLOAT_FLOAT_PARAMETER, (Void) callback, NULL); } static int getParameterCount(action_type_e parameterType) {