auto-sync
This commit is contained in:
parent
dbda7ec7e9
commit
27b0cca4ef
|
@ -533,14 +533,14 @@ extern pin_output_mode_e DEFAULT_OUTPUT;
|
|||
|
||||
static void initStatisLeds() {
|
||||
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
||||
outputPinRegisterExt2("communication status 1", &communicationPin,
|
||||
outputPinRegisterExt2("led: comm status", &communicationPin,
|
||||
engineConfiguration->communicationPin, &DEFAULT_OUTPUT);
|
||||
#endif
|
||||
|
||||
#if EFI_WARNING_LED || defined(__DOXYGEN__)
|
||||
outputPinRegister("warning", &warningPin, LED_WARNING_PORT,
|
||||
outputPinRegister("led: warning status", &warningPin, LED_WARNING_PORT,
|
||||
LED_WARNING_PIN);
|
||||
outputPinRegisterExt2("is running status", &runningPin, engineConfiguration->runningPin,
|
||||
outputPinRegisterExt2("led: running status", &runningPin, engineConfiguration->runningPin,
|
||||
&DEFAULT_OUTPUT);
|
||||
#endif /* EFI_WARNING_LED */
|
||||
}
|
||||
|
|
|
@ -59,6 +59,7 @@ public:
|
|||
void setConfig(thermistor_conf_s *config);
|
||||
void prepareThermistorCurve(thermistor_conf_s *tc);
|
||||
bool isLinearSensor();
|
||||
float getKelvinTemperatureByResistance(float resistance);
|
||||
float s_h_a;
|
||||
float s_h_b;
|
||||
float s_h_c;
|
||||
|
|
|
@ -49,14 +49,13 @@ float getVoutInVoltageDividor(float Vin, float r1, float r2) {
|
|||
return r2 * Vin / (r1 + r2);
|
||||
}
|
||||
|
||||
float getKelvinTemperature(float resistance, ThermistorMath *tm) {
|
||||
|
||||
float ThermistorMath::getKelvinTemperatureByResistance(float resistance) {
|
||||
if (resistance <= 0) {
|
||||
//warning("Invalid resistance in getKelvinTemperature=", resistance);
|
||||
return 0.0f;
|
||||
}
|
||||
float logR = logf(resistance);
|
||||
return 1 / (tm->s_h_a + tm->s_h_b * logR + tm->s_h_c * logR * logR * logR);
|
||||
return 1 / (s_h_a + s_h_b * logR + s_h_c * logR * logR * logR);
|
||||
}
|
||||
|
||||
float convertCelsiustoF(float tempC) {
|
||||
|
@ -90,7 +89,7 @@ float getTemperatureC(ThermistorConf *config, ThermistorMath *tm) {
|
|||
float voltage = getVoltageDivided("term", config->adcChannel);
|
||||
float resistance = getResistance(config, voltage);
|
||||
|
||||
float kelvinTemperature = getKelvinTemperature(resistance, tm);
|
||||
float kelvinTemperature = tm->getKelvinTemperatureByResistance(resistance);
|
||||
return convertKelvinToCelcius(kelvinTemperature);
|
||||
}
|
||||
|
||||
|
@ -216,7 +215,7 @@ void setCommonNTCSensor(ThermistorConf *thermistorConf) {
|
|||
#if EFI_PROD_CODE
|
||||
static void testCltByR(float resistance) {
|
||||
// we expect slowPeriodicCallback to already update configuration in the curve helper class see setConfig
|
||||
float kTemp = getKelvinTemperature(resistance, &engine->engineState.cltCurve);
|
||||
float kTemp = engine->engineState.cltCurve.getKelvinTemperatureByResistance(resistance);
|
||||
scheduleMsg(logger, "for R=%f we have %f", resistance, (kTemp - KELV));
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -41,13 +41,13 @@ void initTriggerEmulator(Logging *sharedLogger, Engine *engine) {
|
|||
|
||||
#if EFI_PROD_CODE
|
||||
// todo: refactor, make this a loop
|
||||
outputPinRegisterExt2("distributor ch1", triggerSignal.outputPins[0], boardConfiguration->triggerSimulatorPins[0],
|
||||
outputPinRegisterExt2("trg emulator ch1", triggerSignal.outputPins[0], boardConfiguration->triggerSimulatorPins[0],
|
||||
&boardConfiguration->triggerSimulatorPinModes[0]);
|
||||
|
||||
outputPinRegisterExt2("distributor ch2", triggerSignal.outputPins[1], boardConfiguration->triggerSimulatorPins[1],
|
||||
outputPinRegisterExt2("trg emulator ch2", triggerSignal.outputPins[1], boardConfiguration->triggerSimulatorPins[1],
|
||||
&boardConfiguration->triggerSimulatorPinModes[1]);
|
||||
|
||||
outputPinRegisterExt2("distributor ch3", triggerSignal.outputPins[2], boardConfiguration->triggerSimulatorPins[2],
|
||||
outputPinRegisterExt2("trg emulator ch3", triggerSignal.outputPins[2], boardConfiguration->triggerSimulatorPins[2],
|
||||
&boardConfiguration->triggerSimulatorPinModes[2]);
|
||||
#endif /* EFI_PROD_CODE */
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ void outputPinRegister(const char *msg, OutputPin *output, ioportid_t port, uint
|
|||
extern OutputPin checkEnginePin;
|
||||
|
||||
void initPrimaryPins(void) {
|
||||
outputPinRegister("LED_ERROR", &enginePins.errorLedPin, LED_ERROR_PORT, LED_ERROR_PIN);
|
||||
outputPinRegister("led: ERROR status", &enginePins.errorLedPin, LED_ERROR_PORT, LED_ERROR_PIN);
|
||||
}
|
||||
|
||||
void initOutputPins(void) {
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,96 +0,0 @@
|
|||
update=6/30/2016 5:01:41 AM
|
||||
version=1
|
||||
last_client=kicad
|
||||
[cvpcb]
|
||||
version=1
|
||||
NetIExt=net
|
||||
[cvpcb/libraries]
|
||||
EquName1=devcms
|
||||
[general]
|
||||
version=1
|
||||
[eeschema]
|
||||
version=1
|
||||
LibDir=../rusefi_lib
|
||||
[eeschema/libraries]
|
||||
LibName1=KICAD_Older_Version
|
||||
LibName2=power
|
||||
LibName3=device
|
||||
LibName4=transistors
|
||||
LibName5=conn
|
||||
LibName6=linear
|
||||
LibName7=regul
|
||||
LibName8=74xx
|
||||
LibName9=cmos4000
|
||||
LibName10=adc-dac
|
||||
LibName11=memory
|
||||
LibName12=xilinx
|
||||
LibName13=microcontrollers
|
||||
LibName14=dsp
|
||||
LibName15=microchip
|
||||
LibName16=analog_switches
|
||||
LibName17=motorola
|
||||
LibName18=texas
|
||||
LibName19=intel
|
||||
LibName20=audio
|
||||
LibName21=interface
|
||||
LibName22=digital-audio
|
||||
LibName23=philips
|
||||
LibName24=display
|
||||
LibName25=cypress
|
||||
LibName26=siliconi
|
||||
LibName27=opto
|
||||
LibName28=atmel
|
||||
LibName29=contrib
|
||||
LibName30=valves
|
||||
LibName31=176122-6
|
||||
LibName32=art-electro-conn
|
||||
LibName33=art-electro-conn_2
|
||||
LibName34=art-electro-ic
|
||||
LibName35=art-electro-max
|
||||
LibName36=art-electro-power
|
||||
LibName37=LMV324IDR
|
||||
LibName38=logo
|
||||
LibName39=logo_flipped
|
||||
LibName40=MAX9926-9927
|
||||
LibName41=max9939
|
||||
LibName42=max31855
|
||||
LibName43=stm32
|
||||
LibName44=tc4427
|
||||
LibName45=lm2596
|
||||
LibName46=mos_p_numbered-pins
|
||||
LibName47=rn-41
|
||||
LibName48=skqucaa010_joystick
|
||||
LibName49=itead_hc-0X_bluetooth
|
||||
LibName50=joystick_SKRHAAE010
|
||||
LibName51=STM32F407IGT6
|
||||
LibName52=slc_oem
|
||||
LibName53=mos_n_numbered-pins
|
||||
[pcbnew]
|
||||
version=1
|
||||
PageLayoutDescrFile=../rusefi_lib/Border.kicad_wks
|
||||
LastNetListRead=frankenso.net
|
||||
PadDrill=0
|
||||
PadDrillOvalY=0
|
||||
PadSizeH=0.70104
|
||||
PadSizeV=1.6002
|
||||
PcbTextSizeV=1.016
|
||||
PcbTextSizeH=1.016
|
||||
PcbTextThickness=0.127
|
||||
ModuleTextSizeV=0.508
|
||||
ModuleTextSizeH=0.508
|
||||
ModuleTextSizeThickness=0.127
|
||||
SolderMaskClearance=0.2
|
||||
SolderMaskMinWidth=0
|
||||
DrawSegmentWidth=0.127
|
||||
BoardOutlineThickness=0.127
|
||||
ModuleOutlineThickness=0.254
|
||||
[schematic_editor]
|
||||
version=1
|
||||
PageLayoutDescrFile=../rusefi_lib/Border.kicad_wks
|
||||
PlotDirectoryName=
|
||||
SubpartIdSeparator=0
|
||||
SubpartFirstId=65
|
||||
NetFmtName=
|
||||
SpiceForceRefPrefix=0
|
||||
SpiceUseNetNumbers=0
|
||||
LabSize=60
|
|
@ -1,234 +0,0 @@
|
|||
EESchema Schematic File Version 2
|
||||
LIBS:KICAD_Older_Version
|
||||
LIBS:power
|
||||
LIBS:device
|
||||
LIBS:transistors
|
||||
LIBS:conn
|
||||
LIBS:linear
|
||||
LIBS:regul
|
||||
LIBS:74xx
|
||||
LIBS:cmos4000
|
||||
LIBS:adc-dac
|
||||
LIBS:memory
|
||||
LIBS:xilinx
|
||||
LIBS:microcontrollers
|
||||
LIBS:dsp
|
||||
LIBS:microchip
|
||||
LIBS:analog_switches
|
||||
LIBS:motorola
|
||||
LIBS:texas
|
||||
LIBS:intel
|
||||
LIBS:audio
|
||||
LIBS:interface
|
||||
LIBS:digital-audio
|
||||
LIBS:philips
|
||||
LIBS:display
|
||||
LIBS:cypress
|
||||
LIBS:siliconi
|
||||
LIBS:opto
|
||||
LIBS:atmel
|
||||
LIBS:contrib
|
||||
LIBS:valves
|
||||
LIBS:176122-6
|
||||
LIBS:art-electro-conn
|
||||
LIBS:art-electro-conn_2
|
||||
LIBS:art-electro-ic
|
||||
LIBS:art-electro-max
|
||||
LIBS:art-electro-power
|
||||
LIBS:LMV324IDR
|
||||
LIBS:logo
|
||||
LIBS:logo_flipped
|
||||
LIBS:MAX9926-9927
|
||||
LIBS:max9939
|
||||
LIBS:max31855
|
||||
LIBS:stm32
|
||||
LIBS:tc4427
|
||||
LIBS:lm2596
|
||||
LIBS:mos_p_numbered-pins
|
||||
LIBS:rn-41
|
||||
LIBS:skqucaa010_joystick
|
||||
LIBS:itead_hc-0X_bluetooth
|
||||
LIBS:joystick_SKRHAAE010
|
||||
LIBS:STM32F407IGT6
|
||||
LIBS:slc_oem
|
||||
LIBS:mos_n_numbered-pins
|
||||
LIBS:frankenso_manhattan_io-cache
|
||||
EELAYER 25 0
|
||||
EELAYER END
|
||||
$Descr B 17000 11000
|
||||
encoding utf-8
|
||||
Sheet 1 1
|
||||
Title "Frankenso"
|
||||
Date "3 dec 2015"
|
||||
Rev ".05"
|
||||
Comp "rusEFI.com"
|
||||
Comment1 ""
|
||||
Comment2 ""
|
||||
Comment3 ""
|
||||
Comment4 ""
|
||||
$EndDescr
|
||||
$Comp
|
||||
L MICRO-SDCARD-CONNECTOR-3300060P1 P?
|
||||
U 1 1 5860621F
|
||||
P 9500 4950
|
||||
F 0 "P?" H 9350 5450 60 0000 C CNN
|
||||
F 1 "MICRO-SDCARD-CONNECTOR-3300060P1" H 9500 4450 60 0001 C CNN
|
||||
F 2 "MICRO-SDCARD-CONNECTOR-3300060P1" H 9500 4950 60 0001 C CNN
|
||||
F 3 "" H 9500 4950 60 0000 C CNN
|
||||
F 4 "seeed,3300060P1" H 9500 4950 60 0001 C CNN "VEND2,VEND2#"
|
||||
1 9500 4950
|
||||
-1 0 0 -1
|
||||
$EndComp
|
||||
NoConn ~ 9900 4550
|
||||
NoConn ~ 9900 5250
|
||||
NoConn ~ 9900 5350
|
||||
$Comp
|
||||
L GND #PWR?
|
||||
U 1 1 58606229
|
||||
P 9900 5050
|
||||
F 0 "#PWR?" H 9900 5050 30 0001 C CNN
|
||||
F 1 "GND" H 9900 4980 30 0001 C CNN
|
||||
F 2 "" H 9900 5050 60 0001 C CNN
|
||||
F 3 "" H 9900 5050 60 0001 C CNN
|
||||
1 9900 5050
|
||||
1 0 0 -1
|
||||
$EndComp
|
||||
Wire Wire Line
|
||||
10075 4950 9900 4950
|
||||
Wire Wire Line
|
||||
9900 5150 10075 5150
|
||||
Wire Wire Line
|
||||
10075 4850 9900 4850
|
||||
Wire Wire Line
|
||||
10075 4750 9900 4750
|
||||
Wire Wire Line
|
||||
10075 4650 9900 4650
|
||||
$Comp
|
||||
L CP1 C?
|
||||
U 1 1 58606237
|
||||
P 7950 5225
|
||||
F 0 "C?" H 8000 5325 50 0000 L CNN
|
||||
F 1 "4.7uF" H 8000 5125 50 0000 L CNN
|
||||
F 2 "SM0805" V 2180 2100 60 0001 C CNN
|
||||
F 3 "" H 7950 5225 60 0001 C CNN
|
||||
F 4 "TDK,CGA4J3X5R1H475K125AB" V 2180 2100 60 0001 C CNN "MFG,MFG#"
|
||||
F 5 "DIGI,445-7882-6-ND" V 2180 2100 60 0001 C CNN "VEND1,VEND1#"
|
||||
1 7950 5225
|
||||
-1 0 0 -1
|
||||
$EndComp
|
||||
$Comp
|
||||
L C C?
|
||||
U 1 1 58606240
|
||||
P 7950 4675
|
||||
F 0 "C?" H 8000 4775 50 0000 L CNN
|
||||
F 1 "0.1uF" H 8000 4575 50 0000 L CNN
|
||||
F 2 "SM0805" V 2180 2100 60 0001 C CNN
|
||||
F 3 "" H 7950 4675 60 0001 C CNN
|
||||
F 4 "AVX,08055C104KAT2A" V 2180 2100 60 0001 C CNN "MFG,MFG#"
|
||||
F 5 "DIGI,478-1395-1-ND" V 2180 2100 60 0001 C CNN "VEND1,VEND1#"
|
||||
1 7950 4675
|
||||
1 0 0 -1
|
||||
$EndComp
|
||||
Wire Wire Line
|
||||
7950 4875 7950 5025
|
||||
Wire Wire Line
|
||||
7650 4975 7950 4975
|
||||
Connection ~ 7950 4975
|
||||
$Comp
|
||||
L GND #PWR?
|
||||
U 1 1 5860624A
|
||||
P 7950 5425
|
||||
F 0 "#PWR?" H 7950 5425 30 0001 C CNN
|
||||
F 1 "GND" H 7950 5355 30 0001 C CNN
|
||||
F 2 "" H 7950 5425 60 0001 C CNN
|
||||
F 3 "" H 7950 5425 60 0001 C CNN
|
||||
1 7950 5425
|
||||
1 0 0 -1
|
||||
$EndComp
|
||||
$Comp
|
||||
L GND #PWR?
|
||||
U 1 1 58606250
|
||||
P 7950 4475
|
||||
F 0 "#PWR?" H 7950 4475 30 0001 C CNN
|
||||
F 1 "GND" H 7950 4405 30 0001 C CNN
|
||||
F 2 "" H 7950 4475 60 0001 C CNN
|
||||
F 3 "" H 7950 4475 60 0001 C CNN
|
||||
1 7950 4475
|
||||
-1 0 0 1
|
||||
$EndComp
|
||||
Text Label 7650 4975 2 60 ~ 0
|
||||
3.3V
|
||||
$Comp
|
||||
L GND #PWR?
|
||||
U 1 1 58606257
|
||||
P 8900 5150
|
||||
F 0 "#PWR?" H 8900 5150 30 0001 C CNN
|
||||
F 1 "GND" H 8900 5080 30 0001 C CNN
|
||||
F 2 "" H 8900 5150 60 0001 C CNN
|
||||
F 3 "" H 8900 5150 60 0001 C CNN
|
||||
1 8900 5150
|
||||
1 0 0 -1
|
||||
$EndComp
|
||||
Wire Wire Line
|
||||
8900 4800 8900 5150
|
||||
Connection ~ 8900 4900
|
||||
Connection ~ 8900 5000
|
||||
Connection ~ 8900 5100
|
||||
Text HLabel 10100 5050 2 60 Input ~ 0
|
||||
GND
|
||||
Text HLabel 10075 4650 2 60 Input ~ 0
|
||||
CS_SD_MODULE
|
||||
Text HLabel 10075 4750 2 60 Input ~ 0
|
||||
SPI_MOSI
|
||||
Text HLabel 10075 4850 2 60 Input ~ 0
|
||||
3.3V
|
||||
Text HLabel 10075 4950 2 60 Input ~ 0
|
||||
SPI_SCK
|
||||
Text HLabel 10075 5150 2 60 Input ~ 0
|
||||
SPI_MISO
|
||||
Wire Wire Line
|
||||
9900 5050 10100 5050
|
||||
$Comp
|
||||
L MINI-USB-5P-3400020P1 J?
|
||||
U 1 1 5860626B
|
||||
P 8750 1575
|
||||
F 0 "J?" H 8475 1925 60 0000 C CNN
|
||||
F 1 "MINI-USB-5P-3400020P1V" H 8750 2025 60 0001 C CNN
|
||||
F 2 "MINI-USB_RCTP_V-T_B" V 7830 2875 60 0001 C CNN
|
||||
F 3 "" H 8750 1575 60 0001 C CNN
|
||||
F 4 "TE,1734753-1" V 7830 2875 60 0001 C CNN "MFG,MFG#"
|
||||
F 5 "DIGI,A107790-ND" V 7830 2875 60 0001 C CNN "VEND1,VEND1#"
|
||||
1 8750 1575
|
||||
1 0 0 -1
|
||||
$EndComp
|
||||
Text Label 8950 1425 0 60 ~ 0
|
||||
D-
|
||||
Text Label 8950 1525 0 60 ~ 0
|
||||
D+
|
||||
$Comp
|
||||
L GND #PWR?
|
||||
U 1 1 58606274
|
||||
P 8950 1725
|
||||
F 0 "#PWR?" H 8950 1725 30 0001 C CNN
|
||||
F 1 "GND" H 8950 1655 30 0001 C CNN
|
||||
F 2 "" H 8950 1725 60 0001 C CNN
|
||||
F 3 "" H 8950 1725 60 0001 C CNN
|
||||
1 8950 1725
|
||||
0 -1 -1 0
|
||||
$EndComp
|
||||
Text Label 8950 1825 0 60 ~ 0
|
||||
shield
|
||||
Text Label 8950 1325 0 60 ~ 0
|
||||
Vbus
|
||||
$Comp
|
||||
L PWR_FLAG #FLG?
|
||||
U 1 1 586062BD
|
||||
P 8950 1625
|
||||
F 0 "#FLG?" H 8950 1720 30 0001 C CNN
|
||||
F 1 "PWR_FLAG" H 8950 1805 30 0000 C CNN
|
||||
F 2 "" H 8950 1625 60 0000 C CNN
|
||||
F 3 "" H 8950 1625 60 0000 C CNN
|
||||
1 8950 1625
|
||||
0 1 1 0
|
||||
$EndComp
|
||||
$EndSCHEMATC
|
|
@ -92,7 +92,7 @@ void testSensors(void) {
|
|||
{
|
||||
setThermistorConfiguration(&tc, 32, 9500, 75, 2100, 120, 1000);
|
||||
tm.setConfig(&tc.config);
|
||||
float t = getKelvinTemperature(2100, &tm);
|
||||
float t = tm.getKelvinTemperatureByResistance(2100);
|
||||
assertEquals(75 + KELV, t);
|
||||
|
||||
assertEquals(-0.003, tm.s_h_a);
|
||||
|
@ -106,7 +106,7 @@ void testSensors(void) {
|
|||
setThermistorConfiguration(&tc, 0, 32500, 30, 7550, 100, 700);
|
||||
tm.setConfig(&tc.config);
|
||||
|
||||
float t = getKelvinTemperature(38000, &tm);
|
||||
float t = tm.getKelvinTemperatureByResistance(38000);
|
||||
assertEquals(-2.7983, t - KELV);
|
||||
|
||||
assertEqualsM("A", 0.0009, tm.s_h_a);
|
||||
|
|
Loading…
Reference in New Issue