From da729ec6915c0094f111609d9f9b7e46162b8c13 Mon Sep 17 00:00:00 2001 From: Karl Palsson Date: Sun, 25 Feb 2018 22:46:21 +0000 Subject: adc-power: add parallel parent makefile and fix the bugs it shows from me not maintaining this code! --- tests/adc-power/Makefile | 15 +++++++++++++++ tests/adc-power/adc-power.c | 2 ++ tests/adc-power/main-stm32f072-disco.c | 2 +- tests/adc-power/main-stm32l4-disco.c | 2 +- 4 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 tests/adc-power/Makefile diff --git a/tests/adc-power/Makefile b/tests/adc-power/Makefile new file mode 100644 index 0000000..52841cd --- /dev/null +++ b/tests/adc-power/Makefile @@ -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 + diff --git a/tests/adc-power/adc-power.c b/tests/adc-power/adc-power.c index 0904bb3..bcd9c87 100644 --- a/tests/adc-power/adc-power.c +++ b/tests/adc-power/adc-power.c @@ -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 } diff --git a/tests/adc-power/main-stm32f072-disco.c b/tests/adc-power/main-stm32f072-disco.c index 4a960e1..744c384 100644 --- a/tests/adc-power/main-stm32f072-disco.c +++ b/tests/adc-power/main-stm32f072-disco.c @@ -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); diff --git a/tests/adc-power/main-stm32l4-disco.c b/tests/adc-power/main-stm32l4-disco.c index aebcb69..37a3241 100644 --- a/tests/adc-power/main-stm32l4-disco.c +++ b/tests/adc-power/main-stm32l4-disco.c @@ -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); -- cgit