diff --git a/firmware/config/stm32f4ems/efifeatures.h b/firmware/config/stm32f4ems/efifeatures.h index 79e3665604..d1534c1ec0 100644 --- a/firmware/config/stm32f4ems/efifeatures.h +++ b/firmware/config/stm32f4ems/efifeatures.h @@ -318,8 +318,6 @@ */ #define EFI_UART_GPS FALSE -#define EFI_SERVO FALSE - #define EFI_ELECTRONIC_THROTTLE_BODY TRUE //#define EFI_ELECTRONIC_THROTTLE_BODY FALSE diff --git a/firmware/hw_layer/hardware.cpp b/firmware/hw_layer/hardware.cpp index 197fc296c4..9ae259f0b8 100644 --- a/firmware/hw_layer/hardware.cpp +++ b/firmware/hw_layer/hardware.cpp @@ -10,7 +10,6 @@ #include "os_access.h" #include "trigger_input.h" -#include "servo.h" #include "can_hw.h" #include "hardware.h" #include "rtc_helper.h" @@ -574,10 +573,6 @@ void initHardware() { initGps(); #endif -#if EFI_SERVO - initServo(); -#endif - #if EFI_AUX_SERIAL initAuxSerial(); #endif /* EFI_AUX_SERIAL */ diff --git a/firmware/hw_layer/hw_layer.mk b/firmware/hw_layer/hw_layer.mk index e6a17781dc..41e99094ba 100644 --- a/firmware/hw_layer/hw_layer.mk +++ b/firmware/hw_layer/hw_layer.mk @@ -25,7 +25,6 @@ HW_LAYER_EMS_CPP = \ $(PROJECT_DIR)/hw_layer/mc33816.cpp \ $(PROJECT_DIR)/hw_layer/stepper.cpp \ $(PROJECT_DIR)/hw_layer/stepper_dual_hbridge.cpp \ - $(PROJECT_DIR)/hw_layer/servo.cpp \ $(PROJECT_DIR)/hw_layer/io_pins.cpp \ $(PROJECT_DIR)/hw_layer/rtc_helper.cpp \ $(PROJECT_DIR)/hw_layer/cdm_ion_sense.cpp \ diff --git a/firmware/hw_layer/servo.cpp b/firmware/hw_layer/servo.cpp deleted file mode 100644 index 096046ba92..0000000000 --- a/firmware/hw_layer/servo.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @file servo.cpp - * - * http://rusefi.com/wiki/index.php?title=Hardware:Servo_motor - * - * SG90 pinout: - * brown GND - * red VCC - * orange PWM signal - * - * @date Jan 3, 2015 - * @author Andrey Belomutskiy, (c) 2012-2020 - */ - -#include "pch.h" - -#if EFI_SERVO || EFI_SIMULATOR -#include "servo.h" - -// This thread calls scheduleForLater which eventually could trip the main trigger callback -// if self stimulation (heh) is enabled, which uses a TON of stack space. -// So this stack has to be pretty big, unfortunately. -THD_WORKING_AREA(servoThreadStack, UTILITY_THREAD_STACK_SIZE * 3); - -static OutputPin pins[SERVO_COUNT]; - -static scheduling_s servoTurnSignalOff; - -// todo: extract common 'pin off' callback? -static void servoTachPinLow(OutputPin *pin) { - pin->setValue(false); -} - -static msg_t seThread(void *arg) { - (void)arg; - chRegSetThreadName("servo"); - while (true) { - - OutputPin *pin = &pins[0]; - pin->setValue(1); - - - percent_t position = (currentTimeMillis() / 5) % 200; - if (position > 100) - position = 200 - position; - - float durationMs = 0 + position * 0.02f; - - engine->executor.scheduleForLater("servo", &servoTurnSignalOff, (int)MS2US(durationMs), { &servoTachPinLow, pin }); - - - chThdSleepMilliseconds(19); - } - return 0; -} - -void initServo(void) { - for (int i = 0; i < SERVO_COUNT; i ++) { - brain_pin_e p = engineConfiguration->servoOutputPins[i]; - pins[i].initPin("servo", p); - } - - chThdCreateStatic(servoThreadStack, sizeof(servoThreadStack), PRIO_SERVO, (tfunc_t)(void*) seThread, NULL); -} -#endif /* EFI_SERVO */ - diff --git a/firmware/hw_layer/servo.h b/firmware/hw_layer/servo.h deleted file mode 100644 index e1da3e235b..0000000000 --- a/firmware/hw_layer/servo.h +++ /dev/null @@ -1,13 +0,0 @@ -/** - * @file servo.h - * - * @date Jan 3, 2015 - * @author Andrey Belomutskiy, (c) 2012-2020 - */ - -#pragma once - -#include "global.h" - -void initServo(void); - diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 8f49f90436..8f22266e8b 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -128,8 +128,6 @@ struct_no_prefix engine_configuration_s ! https://github.com/rusefi/rusefi/issues/2010 shows the corner case wheel with huge depth requirement #define GAP_TRACKING_LENGTH 18 -#define SERVO_COUNT 8 - #define CONSOLE_DATA_PROTOCOL_TAG " @" #define MAIN_HELP_URL "http://www.rusefi.com/" @@ -1333,7 +1331,7 @@ custom stepper_num_micro_steps_e 1 bits, U08, @OFFSET@, [0:3], @@stepper_num_mic pin_output_mode_e tle8888_csPinMode; Gpio mc33816_cs; - Gpio[SERVO_COUNT iterate] servoOutputPins;todo: more comments + Gpio[8 iterate] sorryUnused int16_t coastingFuelCutRpmHigh;+This sets the RPM above which fuel cut is active.;"rpm", 1, 0, 0, 5000, 0 int16_t coastingFuelCutRpmLow;+This sets the RPM below which fuel cut is deactivated, this prevents jerking or issues transitioning to idle;"rpm", 1, 0, 0, 5000, 0 diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index 96316ae6f7..fe173844aa 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -2548,11 +2548,6 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_ panel = allPinsSensors dialog = allPins3_2 - field = "servo#1", servoOutputPins1 - field = "servo#2", servoOutputPins2 - field = "servo#3", servoOutputPins3 - field = "servo#4", servoOutputPins4 - field = "servo#5", servoOutputPins5 field = "VVT Pin #1", vvtPins1 field = "VVT Pin #2", vvtPins2 field = "VVT Pin #3", vvtPins3 diff --git a/simulator/simulator/efifeatures.h b/simulator/simulator/efifeatures.h index b759b7215e..1eca675f6d 100644 --- a/simulator/simulator/efifeatures.h +++ b/simulator/simulator/efifeatures.h @@ -38,8 +38,6 @@ #define EFI_CLOCK_LOCKS FALSE -#define EFI_SERVO FALSE - #define EFI_LCD FALSE #define TS_UART_MODE FALSE