diff --git a/README.md b/README.md index ff5d736..74104b0 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,8 @@ Programming the STM32 ``` cd board ./get_sdk.sh -make +make recover # initially +make # future ``` Programming the ESP diff --git a/board/build.mk b/board/build.mk index f29e897..a2d3017 100644 --- a/board/build.mk +++ b/board/build.mk @@ -27,6 +27,7 @@ bin: obj/$(PROJ_NAME).bin # this flashes everything recover: obj/bootstub.$(PROJ_NAME).bin obj/$(PROJ_NAME).bin -python -c "from panda import Panda; Panda().reset(enter_bootloader=True)" + sleep 0.5 $(DFU_UTIL) -a 0 -s 0x08004000 -D obj/$(PROJ_NAME).bin $(DFU_UTIL) -a 0 -s 0x08000000:leave -D obj/bootstub.$(PROJ_NAME).bin @@ -46,7 +47,7 @@ endif 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 +obj/%.$(PROJ_NAME).o: %.c obj/cert.h obj/gitversion.h config.h drivers/*.h $(CC) $(CFLAGS) -o $@ -c $< obj/%.$(PROJ_NAME).o: ../crypto/%.c diff --git a/board/dac.h b/board/drivers/dac.h similarity index 100% rename from board/dac.h rename to board/drivers/dac.h diff --git a/board/drivers/drivers.h b/board/drivers/drivers.h index 1f48e7f..732746d 100644 --- a/board/drivers/drivers.h +++ b/board/drivers/drivers.h @@ -1,3 +1,6 @@ +#ifndef PANDA_DRIVERS_H +#define PANDA_DRIVERS_H + // ********************* USB ********************* // IRQs: OTG_FS @@ -61,6 +64,12 @@ void adc_init(); uint32_t adc_get(int channel); +// ********************* DAC ********************* + +void dac_init(); +uint32_t dac_set(int channel, uint32_t value); + + // ********************* TIMER ********************* void timer_init(TIM_TypeDef *TIM, int psc); @@ -107,4 +116,5 @@ void can_init_all(); void can_send(CAN_FIFOMailBox_TypeDef *to_push, uint8_t bus_number); int can_pop(can_ring *q, CAN_FIFOMailBox_TypeDef *elem); +#endif diff --git a/boardesp/.gitignore b/boardesp/.gitignore index ddbccd3..bff8f3b 100644 --- a/boardesp/.gitignore +++ b/boardesp/.gitignore @@ -4,3 +4,4 @@ esp-open-sdk a.out cert.h gitversion.h +esp-open-sdk.dmg diff --git a/boardesp/get_sdk_mac.sh b/boardesp/get_sdk_mac.sh new file mode 100755 index 0000000..0bf3dda --- /dev/null +++ b/boardesp/get_sdk_mac.sh @@ -0,0 +1,28 @@ +#!/bin/bash +brew install gnu-sed --with-default-names +brew tap homebrew/dupes +brew install gperf +brew install grep +brew install autoconf +brew install binutils +brew install gawk +brew install wget +brew install automake +brew install libtool +brew install help2man + +hdiutil create esp-open-sdk.dmg -volname "esp-open-sdk" -size 1g -fs "Case-sensitive HFS+" +hdiutil mount esp-open-sdk.dmg +ln -s /Volumes/esp-open-sdk esp-open-sdk +mkdir -p esp-open-sdk +cd esp-open-sdk + +git init +git remote add origin https://github.com/pfalcon/esp-open-sdk.git +git fetch origin +git checkout 03f5e898a059451ec5f3de30e7feff30455f7cec +git submodule init +git submodule update --recursive + +make STANDALONE=y +