mirror of https://github.com/FOME-Tech/fome-fw.git
servo is truly not alive
This commit is contained in:
parent
f243f1608c
commit
06552b6bee
|
@ -318,8 +318,6 @@
|
||||||
*/
|
*/
|
||||||
#define EFI_UART_GPS FALSE
|
#define EFI_UART_GPS FALSE
|
||||||
|
|
||||||
#define EFI_SERVO FALSE
|
|
||||||
|
|
||||||
#define EFI_ELECTRONIC_THROTTLE_BODY TRUE
|
#define EFI_ELECTRONIC_THROTTLE_BODY TRUE
|
||||||
//#define EFI_ELECTRONIC_THROTTLE_BODY FALSE
|
//#define EFI_ELECTRONIC_THROTTLE_BODY FALSE
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
|
|
||||||
#include "os_access.h"
|
#include "os_access.h"
|
||||||
#include "trigger_input.h"
|
#include "trigger_input.h"
|
||||||
#include "servo.h"
|
|
||||||
#include "can_hw.h"
|
#include "can_hw.h"
|
||||||
#include "hardware.h"
|
#include "hardware.h"
|
||||||
#include "rtc_helper.h"
|
#include "rtc_helper.h"
|
||||||
|
@ -574,10 +573,6 @@ void initHardware() {
|
||||||
initGps();
|
initGps();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if EFI_SERVO
|
|
||||||
initServo();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if EFI_AUX_SERIAL
|
#if EFI_AUX_SERIAL
|
||||||
initAuxSerial();
|
initAuxSerial();
|
||||||
#endif /* EFI_AUX_SERIAL */
|
#endif /* EFI_AUX_SERIAL */
|
||||||
|
|
|
@ -25,7 +25,6 @@ HW_LAYER_EMS_CPP = \
|
||||||
$(PROJECT_DIR)/hw_layer/mc33816.cpp \
|
$(PROJECT_DIR)/hw_layer/mc33816.cpp \
|
||||||
$(PROJECT_DIR)/hw_layer/stepper.cpp \
|
$(PROJECT_DIR)/hw_layer/stepper.cpp \
|
||||||
$(PROJECT_DIR)/hw_layer/stepper_dual_hbridge.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/io_pins.cpp \
|
||||||
$(PROJECT_DIR)/hw_layer/rtc_helper.cpp \
|
$(PROJECT_DIR)/hw_layer/rtc_helper.cpp \
|
||||||
$(PROJECT_DIR)/hw_layer/cdm_ion_sense.cpp \
|
$(PROJECT_DIR)/hw_layer/cdm_ion_sense.cpp \
|
||||||
|
|
|
@ -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 */
|
|
||||||
|
|
|
@ -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);
|
|
||||||
|
|
|
@ -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
|
! https://github.com/rusefi/rusefi/issues/2010 shows the corner case wheel with huge depth requirement
|
||||||
#define GAP_TRACKING_LENGTH 18
|
#define GAP_TRACKING_LENGTH 18
|
||||||
|
|
||||||
#define SERVO_COUNT 8
|
|
||||||
|
|
||||||
#define CONSOLE_DATA_PROTOCOL_TAG " @"
|
#define CONSOLE_DATA_PROTOCOL_TAG " @"
|
||||||
#define MAIN_HELP_URL "http://www.rusefi.com/"
|
#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;
|
pin_output_mode_e tle8888_csPinMode;
|
||||||
Gpio mc33816_cs;
|
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 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
|
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
|
||||||
|
|
|
@ -2548,11 +2548,6 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_
|
||||||
panel = allPinsSensors
|
panel = allPinsSensors
|
||||||
|
|
||||||
dialog = allPins3_2
|
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 #1", vvtPins1
|
||||||
field = "VVT Pin #2", vvtPins2
|
field = "VVT Pin #2", vvtPins2
|
||||||
field = "VVT Pin #3", vvtPins3
|
field = "VVT Pin #3", vvtPins3
|
||||||
|
|
|
@ -38,8 +38,6 @@
|
||||||
|
|
||||||
#define EFI_CLOCK_LOCKS FALSE
|
#define EFI_CLOCK_LOCKS FALSE
|
||||||
|
|
||||||
#define EFI_SERVO FALSE
|
|
||||||
|
|
||||||
#define EFI_LCD FALSE
|
#define EFI_LCD FALSE
|
||||||
|
|
||||||
#define TS_UART_MODE FALSE
|
#define TS_UART_MODE FALSE
|
||||||
|
|
Loading…
Reference in New Issue