diff --git a/Jenkinsfile b/Jenkinsfile index b90a8ca3833680..c67a1005151e49 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,8 +6,8 @@ pipeline { script: "git --no-pager show -s --format='%an' ${GIT_COMMIT}" ).trim()}""" - DOCKER_IMAGE_TAG = "panda:build-${env.BUILD_ID}" - DOCKER_NAME = "panda-test-${env.BUILD_ID}" + DOCKER_IMAGE_TAG = "panda:build-${env.GIT_COMMIT}" + DOCKER_NAME = "panda-test-${env.GIT_COMMIT}" } stages { stage('Build Docker Image') { diff --git a/board/build.mk b/board/build.mk index a84ed3fd9d9193..bde461d2103812 100644 --- a/board/build.mk +++ b/board/build.mk @@ -24,6 +24,11 @@ endif DFU_UTIL = "dfu-util" +DEPDIR = generated_dependencies +$(shell mkdir -p -m 777 $(DEPDIR) >/dev/null) +DEPFLAGS = -MT $@ -MMD -MP -MF $(DEPDIR)/$*.Td +POSTCOMPILE = @mv -f $(DEPDIR)/$*.Td $(DEPDIR)/$*.d && touch $@ + # this no longer pushes the bootstub flash: obj/$(PROJ_NAME).bin PYTHONPATH=../ python -c "from python import Panda; Panda().flash('obj/$(PROJ_NAME).bin')" @@ -45,8 +50,9 @@ include ../common/version.mk obj/cert.h: ../crypto/getcertheader.py ../crypto/getcertheader.py ../certs/debug.pub ../certs/release.pub > $@ -obj/%.$(PROJ_NAME).o: %.c obj/cert.h obj/gitversion.h config.h drivers/*.h gpio.h libc.h provision.h safety.h safety/*.h spi_flasher.h - $(CC) $(CFLAGS) -o $@ -c $< +obj/%.$(PROJ_NAME).o: %.c obj/gitversion.h obj/cert.h $(DEPDIR)/%.d + $(CC) $(DEPFLAGS) $(CFLAGS) -o $@ -c $< + $(POSTCOMPILE) obj/%.$(PROJ_NAME).o: ../crypto/%.c $(CC) $(CFLAGS) -o $@ -c $< @@ -59,12 +65,18 @@ obj/$(PROJ_NAME).bin: obj/$(STARTUP_FILE).o obj/main.$(PROJ_NAME).o $(CC) -Wl,--section-start,.isr_vector=0x8004000 $(CFLAGS) -o obj/$(PROJ_NAME).elf $^ $(OBJCOPY) -v -O binary obj/$(PROJ_NAME).elf obj/code.bin SETLEN=1 ../crypto/sign.py obj/code.bin $@ $(CERT) - @BINSIZE=$$(du -b "obj/$(PROJ_NAME).bin" | cut -f 1) ; if [ $$BINSIZE -ge 32768 ]; then echo "ERROR obj/$(PROJ_NAME).bin is too big!"; exit 1; fi; - + @BINSIZE=$$(du -b "obj/$(PROJ_NAME).bin" | cut -f 1) ; \ + if [ $$BINSIZE -ge 32768 ]; then echo "ERROR obj/$(PROJ_NAME).bin is too big!"; exit 1; fi; obj/bootstub.$(PROJ_NAME).bin: obj/$(STARTUP_FILE).o obj/bootstub.$(PROJ_NAME).o obj/sha.$(PROJ_NAME).o obj/rsa.$(PROJ_NAME).o $(CC) $(CFLAGS) -o obj/bootstub.$(PROJ_NAME).elf $^ $(OBJCOPY) -v -O binary obj/bootstub.$(PROJ_NAME).elf $@ +$(DEPDIR)/%.d: ; +.PRECIOUS: $(DEPDIR)/%.d + +include $(wildcard $(patsubst %,$(DEPDIR)/%.d,$(basename $(wildcard *.c)))) + clean: - @rm -f obj/* + @$(RM) obj/* + @rm -rf $(DEPDIR) diff --git a/board/main.c b/board/main.c index 478f8b9423f787..4fb5e9ff0468c9 100644 --- a/board/main.c +++ b/board/main.c @@ -627,7 +627,7 @@ int main() { //puth(usart1_dma); puts(" "); puth(DMA2_Stream5->M0AR); puts(" "); puth(DMA2_Stream5->NDTR); puts("\n"); #ifdef PANDA - int current = adc_get(ADCCHAN_CURRENT); + uint32_t current = adc_get(ADCCHAN_CURRENT); switch (usb_power_mode) { case USB_POWER_CLIENT: diff --git a/board/safety/safety_subaru.h b/board/safety/safety_subaru.h index 9fedf16c64c93d..5d2bd23d24b6a9 100644 --- a/board/safety/safety_subaru.h +++ b/board/safety/safety_subaru.h @@ -123,6 +123,10 @@ static int subaru_fwd_hook(int bus_num, CAN_FIFOMailBox_TypeDef *to_fwd) { if (addr == 545) { return -1; } + // ES LKAS + if (addr == 802) { + return -1; + } return 0; // Main CAN } diff --git a/board/safety/safety_toyota.h b/board/safety/safety_toyota.h index 02fcb36e5d6f83..cbc83860875fde 100644 --- a/board/safety/safety_toyota.h +++ b/board/safety/safety_toyota.h @@ -172,7 +172,9 @@ static int toyota_fwd_hook(int bus_num, CAN_FIFOMailBox_TypeDef *to_fwd) { if ((bus_num == 0 || bus_num == 2) && toyota_camera_forwarded && !toyota_giraffe_switch_1) { int addr = to_fwd->RIR>>21; bool is_lkas_msg = (addr == 0x2E4 || addr == 0x412) && bus_num == 2; - return is_lkas_msg? -1 : (uint8_t)(~bus_num & 0x2); + // in TSSP 2.0 the camera does ACC as well, so filter 0x343 + bool is_acc_msg = (addr == 0x343 && bus_num == 2); + return (is_lkas_msg || is_acc_msg)? -1 : (uint8_t)(~bus_num & 0x2); } return -1; } diff --git a/examples/query_vin_and_stats.py b/examples/query_vin_and_stats.py index cd2185b4a6f11f..09a6289bf2a05f 100755 --- a/examples/query_vin_and_stats.py +++ b/examples/query_vin_and_stats.py @@ -3,7 +3,7 @@ import struct from panda import Panda from hexdump import hexdump -from isotp import isotp_send, isotp_recv +from panda.isotp import isotp_send, isotp_recv # 0x7e0 = Toyota # 0x18DB33F1 for Honda?