move dac to drivers, add sleep

master
Firmware Batman 2017-07-29 17:49:53 -07:00
parent 7b6e176368
commit 9ed4516318
6 changed files with 43 additions and 2 deletions

View File

@ -61,7 +61,8 @@ Programming the STM32
```
cd board
./get_sdk.sh
make
make recover # initially
make # future
```
Programming the ESP

View File

@ -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

View File

@ -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

1
boardesp/.gitignore vendored
View File

@ -4,3 +4,4 @@ esp-open-sdk
a.out
cert.h
gitversion.h
esp-open-sdk.dmg

View File

@ -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