adc-power: add parallel parent makefile

and fix the bugs it shows from me not maintaining this code!
This commit is contained in:
Karl Palsson 2018-02-25 22:46:21 +00:00
parent 9d0983c386
commit da729ec691
4 changed files with 19 additions and 2 deletions

15
tests/adc-power/Makefile Normal file
View file

@ -0,0 +1,15 @@
# This is just a stub makefile used for travis builds
# to keep things all compiling. Normally you'd use
# one of the makefiles directly.
# These hoops are to enable parallel make correctly.
GZ_ALL := $(wildcard Makefile.*)
all: $(GZ_ALL:=.all)
clean: $(GZ_ALL:=.clean)
%.all:
make -f $* all
%.clean:
make -f $* clean

View file

@ -147,6 +147,7 @@ static float adc_calc_tempf(unsigned int ts_v, unsigned int vref) {
float slope = (110-30) * 1.0f / (ST_TSENSE_CAL2_110C - ST_TSENSE_CAL1_30C) * 1.0f;
return slope * (adjusted_vtemp - ST_TSENSE_CAL1_30C) + 30;
#else
(void)vref;
return ts_v * 1.0;
#endif
}
@ -157,6 +158,7 @@ static int adc_calc_tempi(unsigned int ts, unsigned int vref) {
int slope = (110-30) / (ST_TSENSE_CAL2_110C - ST_TSENSE_CAL1_30C);
return slope * (adjusted_vtemp - ST_TSENSE_CAL1_30C) + 30;
#else
(void)vref;
return ts * 1.00;
#endif
}

View file

@ -23,7 +23,7 @@ void setup_usart(void)
usart_set_baudrate(dev, 115200);
usart_set_databits(dev, 8);
usart_set_parity(dev, USART_PARITY_NONE);
usart_set_stopbits(dev, USART_CR2_STOP_1_0BIT);
usart_set_stopbits(dev, USART_CR2_STOPBITS_1);
usart_set_mode(dev, USART_MODE_TX);
usart_set_flow_control(dev, USART_FLOWCONTROL_NONE);

View file

@ -20,7 +20,7 @@
#define LED_DISCO_GREEN_PORT GPIOE
#define LED_DISCO_GREEN_PIN GPIO8
int hack(void) {
static int hack(void) {
pwr_set_vos_scale(PWR_SCALE1);
flash_set_ws(FLASH_ACR_LATENCY_2WS);
rcc_set_msi_range(RCC_CR_MSIRANGE_48MHZ);