diff --git a/sw/airborne/boards/lisa_m_1.0.h b/sw/airborne/boards/lisa_m_1.0.h index 5c9ec2bd87..bf8a1e2067 100644 --- a/sw/airborne/boards/lisa_m_1.0.h +++ b/sw/airborne/boards/lisa_m_1.0.h @@ -41,7 +41,7 @@ /* configuration for aspirin - and more generaly IMUs */ -#define IMU_ACC_DRDY_RCC_GPIO RCC_APB2Periph_GPIOB +#define IMU_ACC_DRDY_RCC_GPIO RCC_APB2ENR_IOPBEN #define IMU_ACC_DRDY_GPIO GPIOB #define IMU_ACC_DRDY_GPIO_PORTSOURCE GPIO_PortSourceGPIOB @@ -77,17 +77,15 @@ #define ADC_CHANNEL_VSUPPLY 3 #endif -#if 0 //FIXME, adapt for libopencm3 /* GPIO mapping for ADC1 pins, overwrites the default in arch/stm32/mcu_periph/adc_arch.c */ // FIXME, this is not very nice, is also stm lib specific #ifdef USE_AD1 #define ADC1_GPIO_INIT(gpio) { \ - (gpio).GPIO_Pin = GPIO_Pin_3 | GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_4; \ - (gpio).GPIO_Mode = GPIO_Mode_AIN; \ - GPIO_Init(GPIOC, (&gpio)); \ + gpio_set_mode(GPIOC, GPIO_MODE_INPUT, \ + GPIO_CNF_INPUT_ANALOG, \ + GPIO3 | GPIO0 | GPIO1 | GPIO4); \ } #endif // USE_AD1 -#endif #define BOARD_HAS_BARO 1 diff --git a/sw/airborne/boards/lisa_m_2.0.h b/sw/airborne/boards/lisa_m_2.0.h index 43ae46acf5..44adc18c16 100644 --- a/sw/airborne/boards/lisa_m_2.0.h +++ b/sw/airborne/boards/lisa_m_2.0.h @@ -81,9 +81,9 @@ // FIXME, this is not very nice, is also stm lib specific #ifdef USE_AD1 #define ADC1_GPIO_INIT(gpio) { \ - (gpio).GPIO_Pin = GPIO_Pin_3 | GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_4; \ - (gpio).GPIO_Mode = GPIO_Mode_AIN; \ - GPIO_Init(GPIOC, (&gpio)); \ + gpio_set_mode(GPIOC, GPIO_MODE_INPUT, \ + GPIO_CNF_INPUT_ANALOG, \ + GPIO3 | GPIO0 | GPIO1 | GPIO4); \ } #endif // USE_AD1 @@ -99,11 +99,11 @@ //#define STM32_PLL_MULT RCC_PLLMul_6 #define PWM_5AND6_TIMER TIM5 -#define PWM_5AND6_RCC RCC_APB1Periph_TIM5 +#define PWM_5AND6_RCC RCC_APB1ENR_TIM5EN #define PWM5_OC 1 #define PWM6_OC 2 #define PWM_5AND6_GPIO GPIOA -#define PWM5_Pin GPIO_Pin_0 -#define PWM6_Pin GPIO_Pin_1 +#define PWM5_Pin GPIO0 +#define PWM6_Pin GPIO1 #endif /* CONFIG_LISA_M_2_0_H */