diff --git a/configs/nucleo-l452re/src/stm32_adc.c b/configs/nucleo-l452re/src/stm32_adc.c index b12471e49b..dde6eb3618 100644 --- a/configs/nucleo-l452re/src/stm32_adc.c +++ b/configs/nucleo-l452re/src/stm32_adc.c @@ -168,7 +168,8 @@ int stm32l4_adc_measure_voltages(uint32_t *vrefint, uint32_t *vbat, uint32_t *ve ssize_t nbytes; struct adc_msg_s sample[ADC1_NCHANNELS] = { 0 }; int nsamples; - int fd, ret, errval; + int ret; + int fd; fd = open("/dev/adc0", O_RDONLY); if (fd < 0) @@ -245,6 +246,7 @@ int stm32l4_adc_measure_voltages(uint32_t *vrefint, uint32_t *vbat, uint32_t *ve tsense = (110 - 30) * (sample[i].am_data - STM32_TSENSE_TSCAL1) / (STM32_TSENSE_TSCAL2 - STM32_TSENSE_TSCAL1) + 30; ainfo("TSENSE: %d -> %d °C\n", sample[i].am_data, tsense); + UNUSED(tsense); break; case ADC1_INTERNAL_VBATDIV3_CHANNEL: diff --git a/configs/nucleo-l452re/src/stm32_bringup.c b/configs/nucleo-l452re/src/stm32_bringup.c index 1eed61443a..571a15fa0c 100644 --- a/configs/nucleo-l452re/src/stm32_bringup.c +++ b/configs/nucleo-l452re/src/stm32_bringup.c @@ -43,7 +43,12 @@ #include #include +#include #include +#include +#include + +#include #include "stm32l4_i2c.h" #include "nucleo-l452re.h" @@ -92,6 +97,24 @@ int stm32_bringup(void) } #endif +#ifdef CONFIG_BUTTONS +#ifdef CONFIG_BUTTONS_LOWER + iinfo("Initializing button driver\n"); + + /* Register the BUTTON driver */ + + ret = btn_lower_initialize("/dev/buttons"); + if (ret < 0) + { + ierr("ERROR: btn_lower_initialize() failed: %d\n", ret); + } +#else + /* Enable BUTTON support for some other purpose */ + + board_button_initialize(); +#endif +#endif /* CONFIG_BUTTONS */ + #ifdef HAVE_I2C_DRIVER /* Get the I2C lower half instance */