auto-sync

This commit is contained in:
rusEfi 2016-02-29 22:02:59 -05:00
parent 1c1b78d850
commit 66f46df7cf
12 changed files with 3539 additions and 33 deletions

View File

@ -112,6 +112,13 @@ icuchannel_t getInputCaptureChannel(brain_pin_e hwPin) {
}
}
/**
* as of Feb 2016, TIM1, TIM2, TIM3 and TIM4 are used for input capture
* (that's the kind of event you need for shaft position sensor)
* ChibiOS limitation is that only channels #1 and #2 could be used for input capture
*
* TODO: migrate slow ADC to software timer so that TIM8 is also available for input capture
*/
ICUDriver * getInputCaptureDriver(brain_pin_e hwPin) {
#if STM32_ICU_USE_TIM1
if (hwPin == GPIOA_8 ||
@ -121,15 +128,25 @@ ICUDriver * getInputCaptureDriver(brain_pin_e hwPin) {
}
#endif
#if STM32_ICU_USE_TIM2
if (hwPin == GPIOA_5) {
if (hwPin == GPIOA_1 ||
hwPin == GPIOA_5 ||
hwPin == GPIOB_3) {
return &ICUD2;
}
#endif
#if STM32_ICU_USE_TIM3
if (hwPin == GPIOC_6) {
if (hwPin == GPIOA_7 ||
hwPin == GPIOC_6 ||
hwPin == GPIOC_7) {
return &ICUD3;
}
#endif
#if STM32_ICU_USE_TIM8
if (hwPin == GPIOC_6 ||
hwPin == GPIOC_7) {
return &ICUD9;
}
#endif
#if STM32_ICU_USE_TIM9
if (hwPin == GPIOA_2 ||
hwPin == GPIOA_3 ||

View File

@ -0,0 +1,142 @@
EESchema Schematic File Version 2
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
EELAYER 25 0
EELAYER END
$Descr B 17000 11000
encoding utf-8
Sheet 1 1
Title "cps_vrs_io_1"
Date "28 feb 2014"
Rev ""
Comp "based on http://code.google.com/p/daecu/"
Comment1 "cps_vrs_io_1"
Comment2 "Art_Electro"
Comment3 "Art_Electro"
Comment4 "Art_Electro"
$EndDescr
Wire Wire Line
4450 1325 3975 1325
Wire Wire Line
2700 1325 3175 1325
Wire Wire Line
2700 1425 3175 1425
Wire Wire Line
4450 1625 3975 1625
Wire Wire Line
4450 1725 3975 1725
Wire Wire Line
4450 1525 3975 1525
Wire Wire Line
4450 1425 3975 1425
Text Notes 2700 1125 0 60 ~ 0
FIRMWARE PINOUT
Text Label 2950 1325 2 60 ~ 0
CAM
Text Label 2775 1425 0 60 ~ 0
CRANK
Entry Wire Line
4450 1425 4550 1525
Entry Wire Line
4450 1525 4550 1625
Entry Wire Line
4450 1725 4550 1825
Entry Wire Line
4450 1625 4550 1725
Entry Wire Line
2600 1625 2700 1525
Entry Wire Line
2600 1525 2700 1425
Entry Wire Line
4450 1325 4550 1425
Entry Wire Line
2600 1425 2700 1325
$Comp
L CONN_5X2 P103
U 1 1 5288F8BF
P 3575 1525
F 0 "P103" H 3575 1825 60 0000 C CNN
F 1 "CONN_5X2" V 3575 1525 50 0000 C CNN
F 2 "PIN_ARRAY_5x2" H 3575 1525 60 0001 C CNN
F 3 "" H 3575 1525 60 0000 C CNN
1 3575 1525
1 0 0 -1
$EndComp
Text Label 4025 1525 0 60 ~ 0
knock1+
Text Label 4025 1625 0 60 ~ 0
knock1-
Text Label 3125 1525 2 60 ~ 0
CS-KN1
Text Label 4150 1725 2 40 ~ 0
SCK
Text Label 2900 1725 2 40 ~ 0
MISO
$Comp
L CONN_4 P104
U 1 1 5288FF50
P 9400 3375
F 0 "P104" V 9350 3375 50 0000 C CNN
F 1 "CONN_4" V 9450 3375 50 0000 C CNN
F 2 "PIN_ARRAY_4x1" H 9400 3375 60 0001 C CNN
F 3 "" H 9400 3375 60 0000 C CNN
1 9400 3375
-1 0 0 -1
$EndComp
$Comp
L GND #PWR06
U 1 1 5289002F
P 3125 1625
F 0 "#PWR06" H 3125 1625 30 0001 C CNN
F 1 "GND" H 3125 1555 30 0001 C CNN
F 2 "" H 3125 1625 60 0001 C CNN
F 3 "" H 3125 1625 60 0001 C CNN
1 3125 1625
0 1 1 0
$EndComp
Entry Wire Line
2600 1825 2700 1725
Wire Wire Line
2700 1725 3175 1725
Wire Wire Line
2700 1525 3175 1525
Text Label 4025 1425 0 60 ~ 0
5v stab
Text Label 4125 1325 2 60 ~ 0
5V
Wire Wire Line
3175 1625 3125 1625
Wire Bus Line
4550 850 4550 1825
Wire Bus Line
2600 850 2600 1825
Wire Bus Line
2600 850 2975 850
$EndSCHEMATC

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,466 @@
(export (version D)
(design
(source C:/Users/Vista_64_D630/Desktop/Jared/code/Hardware/trunk/rusefi.com/VR_Board/vrs_io_1.sch)
(date "2/29/2016 8:02:11 PM")
(tool "Eeschema 4.0.1-stable")
(sheet (number 1) (name /) (tstamps /)
(title_block
(title vrs_io_1)
(company "based on http://code.google.com/p/daecu/")
(rev)
(date "28 feb 2016")
(source vrs_io_1.sch)
(comment (number 1) (value ""))
(comment (number 2) (value ""))
(comment (number 3) (value ""))
(comment (number 4) (value "")))))
(components
(comp (ref C104)
(value 0.1uF)
(footprint SM0805)
(fields
(field (name MFG,MFG#) AVX,08055C104KAT2A)
(field (name VEND1,VEND1#) DIGI,478-1395-1-ND))
(libsource (lib KICAD_Older_Version) (part C))
(sheetpath (names /) (tstamps /))
(tstamp 50D6291F))
(comp (ref R107)
(value 5k)
(footprint SM0805)
(fields
(field (name MFG,MFG#) STACKPOLE,RNCP0805FTD4K99)
(field (name VEND1,VEND1#) DIGI,RNCP0805FTD4K99CT-ND))
(libsource (lib KICAD_Older_Version) (part R))
(sheetpath (names /) (tstamps /))
(tstamp 4E39E3AD))
(comp (ref R102)
(value 5k)
(footprint SM0805)
(fields
(field (name MFG,MFG#) STACKPOLE,RNCP0805FTD4K99)
(field (name VEND1,VEND1#) DIGI,RNCP0805FTD4K99CT-ND))
(libsource (lib KICAD_Older_Version) (part R))
(sheetpath (names /) (tstamps /))
(tstamp 4E39E3A9))
(comp (ref R103)
(value 5k)
(footprint SM0805)
(fields
(field (name MFG,MFG#) STACKPOLE,RNCP0805FTD4K99)
(field (name VEND1,VEND1#) DIGI,RNCP0805FTD4K99CT-ND))
(libsource (lib KICAD_Older_Version) (part R))
(sheetpath (names /) (tstamps /))
(tstamp 4E39E3A5))
(comp (ref R108)
(value 5k)
(footprint SM0805)
(fields
(field (name MFG,MFG#) STACKPOLE,RNCP0805FTD4K99)
(field (name VEND1,VEND1#) DIGI,RNCP0805FTD4K99CT-ND))
(libsource (lib KICAD_Older_Version) (part R))
(sheetpath (names /) (tstamps /))
(tstamp 4E39E3A0))
(comp (ref R106)
(value 5k)
(footprint SM0805)
(fields
(field (name MFG,MFG#) STACKPOLE,RNCP0805FTD4K99)
(field (name VEND1,VEND1#) DIGI,RNCP0805FTD4K99CT-ND))
(libsource (lib KICAD_Older_Version) (part R))
(sheetpath (names /) (tstamps /))
(tstamp 4E39E39D))
(comp (ref R104)
(value 5k)
(footprint SM0805)
(fields
(field (name MFG,MFG#) STACKPOLE,RNCP0805FTD4K99)
(field (name VEND1,VEND1#) DIGI,RNCP0805FTD4K99CT-ND))
(libsource (lib KICAD_Older_Version) (part R))
(sheetpath (names /) (tstamps /))
(tstamp 4E39E39B))
(comp (ref R109)
(value 5k)
(footprint SM0805)
(fields
(field (name MFG,MFG#) STACKPOLE,RNCP0805FTD4K99)
(field (name VEND1,VEND1#) DIGI,RNCP0805FTD4K99CT-ND))
(libsource (lib KICAD_Older_Version) (part R))
(sheetpath (names /) (tstamps /))
(tstamp 4E39E396))
(comp (ref R110)
(value 5k)
(footprint SM0805)
(fields
(field (name MFG,MFG#) STACKPOLE,RNCP0805FTD4K99)
(field (name VEND1,VEND1#) DIGI,RNCP0805FTD4K99CT-ND))
(libsource (lib KICAD_Older_Version) (part R))
(sheetpath (names /) (tstamps /))
(tstamp 4E39E393))
(comp (ref R111)
(value 5k)
(footprint SM0805)
(fields
(field (name MFG,MFG#) STACKPOLE,RNCP0805FTD4K99)
(field (name VEND1,VEND1#) DIGI,RNCP0805FTD4K99CT-ND))
(libsource (lib KICAD_Older_Version) (part R))
(sheetpath (names /) (tstamps /))
(tstamp 4E39E390))
(comp (ref R112)
(value 5k)
(footprint SM0805)
(fields
(field (name MFG,MFG#) STACKPOLE,RNCP0805FTD4K99)
(field (name VEND1,VEND1#) DIGI,RNCP0805FTD4K99CT-ND))
(libsource (lib KICAD_Older_Version) (part R))
(sheetpath (names /) (tstamps /))
(tstamp 4E39E38D))
(comp (ref U101)
(value MAX9926/9927)
(footprint maxim-10-QSOP16)
(fields
(field (name MFG,MFG#) maxim,MAX9926UAEE+)
(field (name VEND1,VEND1#) DIGI,MAX9926UAEE+-ND)
(field (name VEND2,VEND2#) mouser,700-MAX9926UAEE)
(field (name Field6) --)
(field (name Field7) -)
(field (name Field8) other,more,stuff))
(libsource (lib KICAD_Older_Version) (part MAX9926/9927))
(sheetpath (names /) (tstamps /))
(tstamp 4BF90B79))
(comp (ref R114)
(value 10k)
(footprint SM0805)
(fields
(field (name MFG,MFG#) BOURNS,CR0805-FX-1002ELF)
(field (name VEND1,VEND1#) DIGI,CR0805-FX-1002ELFCT-ND))
(libsource (lib KICAD_Older_Version) (part R))
(sheetpath (names /) (tstamps /))
(tstamp 5101D08D))
(comp (ref C102)
(value 1000pF)
(footprint SM0805)
(fields
(field (name MFG,MFG#) "AVX,08052C102KAT2A ")
(field (name VEND1,VEND1#) DIGI,478-1339-1-ND))
(libsource (lib KICAD_Older_Version) (part C))
(sheetpath (names /) (tstamps /))
(tstamp 4AD9CD25))
(comp (ref C103)
(value 10uF)
(footprint SM0805)
(fields
(field (name MFG,MFG#) Murata,GRM21BR71A106KE51L)
(field (name VEND1,VEND1#) DIGI,490-3905-1-ND)
(field (name V) 10V)
(field (name tolerance) 10%)
(field (name construct) "multi layer ceramic")
(field (name misc) other,more,stuff))
(libsource (lib KICAD_Older_Version) (part C))
(sheetpath (names /) (tstamps /))
(tstamp 4AD9CB8E))
(comp (ref C101)
(value 1000pF)
(footprint SM0805)
(fields
(field (name MFG,MFG#) "AVX,08052C102KAT2A ")
(field (name VEND1,VEND1#) DIGI,478-1339-1-ND))
(libsource (lib KICAD_Older_Version) (part C))
(sheetpath (names /) (tstamps /))
(tstamp 4AD9C851))
(comp (ref R113)
(value 10k)
(footprint SM0805)
(fields
(field (name MFG,MFG#) BOURNS,CR0805-FX-1002ELF)
(field (name VEND1,VEND1#) DIGI,CR0805-FX-1002ELFCT-ND))
(libsource (lib KICAD_Older_Version) (part R))
(sheetpath (names /) (tstamps /))
(tstamp 4AD9C75B))
(comp (ref W1003)
(value JMP)
(footprint SM0805)
(fields
(field (name MFG,MFG#) DNP,DNP)
(field (name VEND1,VEND1#) DNP,DNP))
(libsource (lib KICAD_Older_Version) (part TEST))
(sheetpath (names /) (tstamps /))
(tstamp 50CE3E18))
(comp (ref W1002)
(value JMP)
(footprint SM0805)
(fields
(field (name MFG,MFG#) DNP,DNP)
(field (name VEND1,VEND1#) DNP,DNP))
(libsource (lib KICAD_Older_Version) (part TEST))
(sheetpath (names /) (tstamps /))
(tstamp 50CE3DD7))
(comp (ref R137)
(value 1K)
(footprint SM0805)
(fields
(field (name MFG,MFG#) Panasonic,ERA-6AEB102V)
(field (name VEND1,VEND1#) DIGI,P1.0KDACT-ND))
(libsource (lib KICAD_Older_Version) (part R))
(sheetpath (names /) (tstamps /))
(tstamp 4E39E3AF))
(comp (ref R141)
(value 1K)
(footprint SM0805)
(fields
(field (name MFG,MFG#) Panasonic,ERA-6AEB102V)
(field (name VEND1,VEND1#) DIGI,P1.0KDACT-ND))
(libsource (lib KICAD_Older_Version) (part R))
(sheetpath (names /) (tstamps /))
(tstamp 4E39E399))
(comp (ref R801)
(value pdwn)
(footprint SM0805)
(fields
(field (name MFG,MFG#) DNP,DNP)
(field (name VEND1,VEND1#) DNP,DNP))
(libsource (lib KICAD_Older_Version) (part R))
(sheetpath (names /) (tstamps /))
(tstamp 53FD4D54))
(comp (ref R802)
(value pdwn)
(footprint SM0805)
(fields
(field (name MFG,MFG#) DNP,DNP)
(field (name VEND1,VEND1#) DNP,DNP))
(libsource (lib KICAD_Older_Version) (part R))
(sheetpath (names /) (tstamps /))
(tstamp 53FD4DD7))
(comp (ref D801)
(value LED-red)
(footprint LED_0805)
(fields
(field (name MFG,MFG#) lite-on,LTST-C171KRKT)
(field (name VEND1,VEND1#) DIGI,160-1427-1-ND))
(libsource (lib KICAD_Older_Version) (part LED))
(sheetpath (names /) (tstamps /))
(tstamp 55237975))
(comp (ref D802)
(value LED-red)
(footprint LED_0805)
(fields
(field (name MFG,MFG#) lite-on,LTST-C171KRKT)
(field (name VEND1,VEND1#) DIGI,160-1427-1-ND))
(libsource (lib KICAD_Older_Version) (part LED))
(sheetpath (names /) (tstamps /))
(tstamp 5523B6C7))
(comp (ref P103)
(value CONN_5X2)
(footprint PIN_ARRAY_5x2)
(libsource (lib KICAD_Older_Version) (part CONN_5X2))
(sheetpath (names /) (tstamps /))
(tstamp 56D5985D))
(comp (ref P104)
(value CONN_4)
(footprint PIN_ARRAY_4x1)
(libsource (lib KICAD_Older_Version) (part CONN_4))
(sheetpath (names /) (tstamps /))
(tstamp 56D5985E)))
(libparts
(libpart (lib KICAD_Older_Version) (part C)
(footprints
(fp SM*)
(fp C?)
(fp C1-1))
(fields
(field (name Reference) C)
(field (name Value) C))
(pins
(pin (num 1) (name ~) (type passive))
(pin (num 2) (name ~) (type passive))))
(libpart (lib KICAD_Older_Version) (part CONN_4)
(fields
(field (name Reference) P)
(field (name Value) CONN_4))
(pins
(pin (num 1) (name P1) (type passive))
(pin (num 2) (name P2) (type passive))
(pin (num 3) (name P3) (type passive))
(pin (num 4) (name P4) (type passive))))
(libpart (lib KICAD_Older_Version) (part CONN_5X2)
(fields
(field (name Reference) P)
(field (name Value) CONN_5X2))
(pins
(pin (num 1) (name ~) (type passive))
(pin (num 2) (name ~) (type passive))
(pin (num 3) (name ~) (type passive))
(pin (num 4) (name ~) (type passive))
(pin (num 5) (name ~) (type passive))
(pin (num 6) (name ~) (type passive))
(pin (num 7) (name ~) (type passive))
(pin (num 8) (name ~) (type passive))
(pin (num 9) (name ~) (type passive))
(pin (num 10) (name ~) (type passive))))
(libpart (lib KICAD_Older_Version) (part LED)
(footprints
(fp LED-3MM)
(fp LED-5MM)
(fp LED-10MM)
(fp LED-0603)
(fp LED-0805)
(fp LED-1206)
(fp LEDV))
(fields
(field (name Reference) D)
(field (name Value) LED))
(pins
(pin (num 1) (name A) (type passive))
(pin (num 2) (name K) (type passive))))
(libpart (lib KICAD_Older_Version) (part MAX9926/9927)
(footprints
(fp maxim*))
(fields
(field (name Reference) U)
(field (name Value) MAX9926/9927))
(pins
(pin (num 1) (name IN_THRS1) (type passive))
(pin (num 2) (name EXT1) (type passive))
(pin (num 3) (name BIAS1) (type passive))
(pin (num 4) (name COUT1) (type passive))
(pin (num 5) (name COUT2) (type passive))
(pin (num 6) (name BIAS2) (type passive))
(pin (num 7) (name EXT2) (type passive))
(pin (num 8) (name INT_THRS2) (type passive))
(pin (num 9) (name IN2+) (type passive))
(pin (num 10) (name IN2-) (type passive))
(pin (num 11) (name GND) (type passive))
(pin (num 12) (name DIRN/OUT2) (type passive))
(pin (num 13) (name ZERO_EN/OUT1) (type passive))
(pin (num 14) (name VCC) (type passive))
(pin (num 15) (name IN1-) (type passive))
(pin (num 16) (name IN1+) (type passive))))
(libpart (lib KICAD_Older_Version) (part R)
(footprints
(fp R?)
(fp SM0603)
(fp SM0805)
(fp R?-*)
(fp SM1206))
(fields
(field (name Reference) R)
(field (name Value) R))
(pins
(pin (num 1) (name ~) (type passive))
(pin (num 2) (name ~) (type passive))))
(libpart (lib KICAD_Older_Version) (part TEST)
(fields
(field (name Reference) W)
(field (name Value) TEST))
(pins
(pin (num 1) (name 1) (type passive))
(pin (num 2) (name 2) (type passive)))))
(libraries
(library (logical KICAD_Older_Version)
(uri C:\Users\Vista_64_D630\Desktop\Jared\code\Hardware\trunk\rusefi.com\rusefi_lib\KICAD_Older_Version.lib)))
(nets
(net (code 1) (name GND)
(node (ref U101) (pin 8))
(node (ref R801) (pin 1))
(node (ref C103) (pin 1))
(node (ref R802) (pin 1))
(node (ref U101) (pin 13))
(node (ref P103) (pin 7))
(node (ref U101) (pin 12))
(node (ref U101) (pin 11))
(node (ref C104) (pin 2))
(node (ref U101) (pin 1))
(node (ref U101) (pin 3))
(node (ref U101) (pin 6)))
(net (code 2) (name "Net-(R141-Pad2)")
(node (ref R141) (pin 2))
(node (ref W1003) (pin 2))
(node (ref R802) (pin 2)))
(net (code 3) (name "Net-(R137-Pad2)")
(node (ref R137) (pin 2))
(node (ref R801) (pin 2))
(node (ref W1002) (pin 2)))
(net (code 4) (name "Net-(D801-Pad2)")
(node (ref D801) (pin 2))
(node (ref R113) (pin 1)))
(net (code 5) (name "Net-(D802-Pad2)")
(node (ref R114) (pin 2))
(node (ref D802) (pin 2)))
(net (code 7) (name /5V)
(node (ref C103) (pin 2))
(node (ref P103) (pin 2))
(node (ref U101) (pin 14))
(node (ref C104) (pin 1))
(node (ref R137) (pin 1))
(node (ref D802) (pin 1))
(node (ref D801) (pin 1))
(node (ref R141) (pin 1)))
(net (code 8) (name /CRANK)
(node (ref P103) (pin 3))
(node (ref R113) (pin 2))
(node (ref U101) (pin 4)))
(net (code 9) (name /CAM+)
(node (ref R104) (pin 1))
(node (ref P104) (pin 4)))
(net (code 10) (name "Net-(P103-Pad9)")
(node (ref P103) (pin 9)))
(net (code 11) (name "/5v stab")
(node (ref P103) (pin 4)))
(net (code 12) (name /CAM-)
(node (ref R106) (pin 1))
(node (ref P104) (pin 3))
(node (ref W1003) (pin 1)))
(net (code 13) (name /CAM)
(node (ref R114) (pin 1))
(node (ref P103) (pin 1))
(node (ref U101) (pin 5)))
(net (code 14) (name /CRK2-)
(node (ref P104) (pin 2))
(node (ref W1002) (pin 1))
(node (ref R102) (pin 1)))
(net (code 15) (name /CRK2+)
(node (ref P104) (pin 1))
(node (ref R103) (pin 1)))
(net (code 16) (name "Net-(P103-Pad8)")
(node (ref P103) (pin 8)))
(net (code 17) (name "Net-(P103-Pad10)")
(node (ref P103) (pin 10)))
(net (code 18) (name "Net-(P103-Pad6)")
(node (ref P103) (pin 6)))
(net (code 19) (name /CS-KN1)
(node (ref P103) (pin 5)))
(net (code 20) (name "Net-(U101-Pad7)")
(node (ref U101) (pin 7)))
(net (code 21) (name "Net-(R102-Pad2)")
(node (ref R102) (pin 2))
(node (ref R107) (pin 1)))
(net (code 22) (name "Net-(R104-Pad2)")
(node (ref R104) (pin 2))
(node (ref R109) (pin 1)))
(net (code 23) (name "Net-(U101-Pad2)")
(node (ref U101) (pin 2)))
(net (code 24) (name "Net-(R103-Pad2)")
(node (ref R103) (pin 2))
(node (ref R108) (pin 1)))
(net (code 25) (name "Net-(R106-Pad2)")
(node (ref R106) (pin 2))
(node (ref R110) (pin 1)))
(net (code 26) (name "Net-(C101-Pad1)")
(node (ref U101) (pin 16))
(node (ref R111) (pin 1))
(node (ref C101) (pin 1))
(node (ref R108) (pin 2)))
(net (code 27) (name "Net-(C101-Pad2)")
(node (ref R111) (pin 2))
(node (ref R107) (pin 2))
(node (ref C101) (pin 2))
(node (ref U101) (pin 15)))
(net (code 28) (name "Net-(C102-Pad1)")
(node (ref R112) (pin 1))
(node (ref U101) (pin 10))
(node (ref C102) (pin 1))
(node (ref R110) (pin 2)))
(net (code 29) (name "Net-(C102-Pad2)")
(node (ref U101) (pin 9))
(node (ref C102) (pin 2))
(node (ref R112) (pin 2))
(node (ref R109) (pin 2)))))

View File

@ -0,0 +1,53 @@
update=2/29/2016 8:07:21 PM
last_client=kicad
[common]
NetDir=
[general]
version=1
[cvpcb]
version=1
NetIExt=net
[cvpcb/libraries]
EquName1=devcms
[schematic_editor]
version=1
PageLayoutDescrFile=C:/Users/Vista_64_D630/Desktop/Jared/code/Hardware/trunk/rusefi.com/rusefi_lib/Border.kicad_wks
PlotDirectoryName=
SubpartIdSeparator=0
SubpartFirstId=65
NetFmtName=
SpiceForceRefPrefix=0
SpiceUseNetNumbers=0
LabSize=60
[eeschema]
version=1
LibDir=../rusefi_lib
[eeschema/libraries]
LibName1=KICAD_Older_Version
LibName2=power
LibName3=device
LibName4=conn
LibName5=linear
LibName6=interface
LibName7=logo_flipped
LibName8=max9939
LibName9=MAX9926-9927
[pcbnew]
version=1
PageLayoutDescrFile=../rusefi_lib/Border.kicad_wks
LastNetListRead=vrs_io_1.net
PadDrill=0.6
PadDrillOvalY=0.6
PadSizeH=0.35052
PadSizeV=0.70104
PcbTextSizeV=2.032
PcbTextSizeH=1.524
PcbTextThickness=0.4318
ModuleTextSizeV=1.524
ModuleTextSizeH=1.524
ModuleTextSizeThickness=0.254
SolderMaskClearance=0.254
SolderMaskMinWidth=0
DrawSegmentWidth=0.254
BoardOutlineThickness=0.254
ModuleOutlineThickness=0.09906

File diff suppressed because it is too large Load Diff

View File

@ -177,8 +177,8 @@ public class AutoTest {
x = 112;
assertWave(msg, chart, EngineChart.SPARK_1, 0.13333333333333333, x, x + 180, x + 360, x + 540);
x = 0;
assertWaveFall(msg, chart, EngineChart.INJECTOR_1, 0.04666666666666654, x + 180, x + 540);
assertWaveFall(msg, chart, EngineChart.INJECTOR_2, 0.04666666666666654, x, x + 360);
assertWaveFall(msg, chart, EngineChart.INJECTOR_1, 0.13633333333333345, x + 180, x + 540);
assertWaveFall(msg, chart, EngineChart.INJECTOR_2, 0.13633333333333345, x, x + 360);
}
private static void test1995DodgeNeon() {

View File

@ -6,11 +6,7 @@ import com.rusefi.core.MessagesCentral;
import com.rusefi.core.Pair;
import com.rusefi.core.Sensor;
import com.rusefi.core.SensorCentral;
import com.rusefi.io.CommandQueue;
import com.rusefi.io.DataListener;
import com.rusefi.io.IoStream;
import com.rusefi.io.LinkManager;
import com.rusefi.io.CommunicationLoggingHolder;
import com.rusefi.io.*;
import com.rusefi.io.serial.PortHolder;
import com.rusefi.io.serial.SerialIoStream;
import jssc.SerialPort;
@ -324,11 +320,13 @@ public class BinaryProtocol {
continue;
}
ConnectionStatus.INSTANCE.markConnected();
System.arraycopy(response, 1, image.getContent(), offset, requestSize);
offset += requestSize;
}
logger.info("Got configuration from controller.");
ConnectionStatus.INSTANCE.setValue(ConnectionStatus.Value.CONNECTED);
setController(image);
}

View File

@ -1,12 +1,11 @@
package com.rusefi.ui;
package com.rusefi.io;
import com.rusefi.Timeouts;
import com.rusefi.core.EngineTimeListener;
import com.rusefi.core.MessagesCentral;
import com.rusefi.core.Sensor;
import com.rusefi.core.SensorCentral;
import com.rusefi.io.ConnectionWatchdog;
import com.rusefi.io.LinkManager;
import org.jetbrains.annotations.NotNull;
import javax.swing.*;
import java.awt.event.ActionEvent;
@ -20,30 +19,38 @@ import java.util.concurrent.CopyOnWriteArrayList;
public class ConnectionStatus {
// todo: react to any message as connected? how to know if message from controller, not internal message?
private static final String FATAL_MESSAGE_PREFIX = "FATAL";
private boolean isConnected;
@NotNull
private Value value = Value.NOT_CONNECTED;
public enum Value {
NOT_CONNECTED,
LOADING,
CONNECTED
}
public static ConnectionStatus INSTANCE = new ConnectionStatus();
private List<Listener> listeners = new CopyOnWriteArrayList<>();
private final Timer timer = new Timer(Timeouts.CS_TIMEOUT, new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
setValue(Value.NOT_CONNECTED);
}
});
private ConnectionStatus() {
final Timer timer = new Timer(Timeouts.CS_TIMEOUT, new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
setConnected(false);
}
});
LinkManager.engineState.timeListeners.add(new EngineTimeListener() {
@Override
public void onTime(double time) {
markConnected(timer);
markConnected();
}
});
SensorCentral.getInstance().addListener(Sensor.TIME_SECONDS, new SensorCentral.SensorListener() {
@Override
public void onSensorUpdate(double value) {
setConnected(true);
markConnected();
}
});
@ -51,33 +58,39 @@ public class ConnectionStatus {
@Override
public void onMessage(Class clazz, String message) {
if (message.startsWith(FATAL_MESSAGE_PREFIX))
markConnected(timer);
markConnected();
}
});
}
private void markConnected(Timer timer) {
setConnected(true);
public void markConnected() {
if (value == Value.NOT_CONNECTED)
setValue(Value.LOADING);
/**
* this timer will catch engine inactivity and display a warning
*/
timer.restart();
}
private void setConnected(boolean isConnected) {
if (isConnected == this.isConnected)
public void setValue(@NotNull Value value) {
if (value == this.value)
return;
this.isConnected = isConnected;
this.value = value;
for (Listener listener : listeners)
listener.onConnectionStatus(isConnected);
listener.onConnectionStatus(isConnected());
}
public boolean isConnected() {
return isConnected;
return value != Value.NOT_CONNECTED;
}
@NotNull
public Value getValue() {
return value;
}
/**
* @see #setConnected(boolean)
* @see #setValue
*/
public void addListener(Listener listener) {
listeners.add(listener);

View File

@ -3,6 +3,7 @@ package com.rusefi;
import com.rusefi.binaryprotocol.BinaryProtocol;
import com.rusefi.core.EngineState;
import com.rusefi.core.MessagesCentral;
import com.rusefi.io.ConnectionStatus;
import com.rusefi.io.ConnectionWatchdog;
import com.rusefi.io.LinkManager;
import com.rusefi.io.serial.PortHolder;
@ -15,6 +16,7 @@ import com.rusefi.ui.storage.Node;
import com.rusefi.ui.util.DefaultExceptionHandler;
import com.rusefi.ui.util.FrameHelper;
import com.rusefi.ui.util.JustOneInstance;
import com.rusefi.ui.util.UiUtils;
import jssc.SerialPortList;
import javax.swing.*;
@ -34,13 +36,38 @@ import static com.rusefi.ui.storage.PersistentConfiguration.getConfig;
* @see EngineSnifferPanel
*/
public class Launcher {
public static final int CONSOLE_VERSION = 20160213;
public static final int CONSOLE_VERSION = 20160229;
public static final boolean SHOW_STIMULATOR = false;
private static final String TAB_INDEX = "main_tab";
protected static final String PORT_KEY = "port";
protected static final String SPEED_KEY = "speed";
private final String port;
private final JTabbedPane tabbedPane = new JTabbedPane();
private final JTabbedPane tabbedPane = new JTabbedPane() {
@Override
public void paint(Graphics g) {
super.paint(g);
paintStatusText(g);
}
private void paintStatusText(Graphics g) {
Font f = g.getFont();
g.setFont(new Font(f.getName(), f.getStyle(), f.getSize() * 4));
Dimension d = getSize();
String text;
switch (ConnectionStatus.INSTANCE.getValue()) {
case NOT_CONNECTED:
text = "Not connected";
break;
case LOADING:
text = "Loading";
break;
default:
text = "";
}
int labelWidth = g.getFontMetrics().stringWidth(text);
g.drawString(text, (d.width - labelWidth) / 2, d.height / 2);
}
};
private static AtomicReference<String> firmwareVersion = new AtomicReference<>("N/A");
private static Frame staticFrame;
@ -138,6 +165,7 @@ public class Launcher {
@Override
public void onConnectionStatus(boolean isConnected) {
setTitle();
UiUtils.trueRepaint(tabbedPane); // this would repaint status label
}
});

View File

@ -2,6 +2,7 @@ package com.rusefi.ui;
import com.rusefi.core.Sensor;
import com.rusefi.core.SensorCentral;
import com.rusefi.io.ConnectionStatus;
import javax.swing.*;
import java.awt.*;

View File

@ -5,7 +5,7 @@ import com.rusefi.FileLog;
import com.rusefi.binaryprotocol.BinaryProtocol;
import com.rusefi.config.Field;
import com.rusefi.io.CommandQueue;
import com.rusefi.ui.ConnectionStatus;
import com.rusefi.io.ConnectionStatus;
import org.jetbrains.annotations.NotNull;
import javax.swing.*;