From 93106836dfb5c56d695abb1fd5aaf80acff57256 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Tue, 28 Jan 2020 19:27:22 +0100 Subject: [PATCH] intel/aerofc-v1: use hw description methods for timer configuration --- boards/intel/aerofc-v1/src/CMakeLists.txt | 2 +- .../src/{timer_config.c => timer_config.cpp} | 30 ++++--------------- 2 files changed, 7 insertions(+), 25 deletions(-) rename boards/intel/aerofc-v1/src/{timer_config.c => timer_config.cpp} (73%) diff --git a/boards/intel/aerofc-v1/src/CMakeLists.txt b/boards/intel/aerofc-v1/src/CMakeLists.txt index 30d6d19249..f121e41cc7 100644 --- a/boards/intel/aerofc-v1/src/CMakeLists.txt +++ b/boards/intel/aerofc-v1/src/CMakeLists.txt @@ -36,7 +36,7 @@ add_library(drivers_board init.c led.c spi.c - timer_config.c + timer_config.cpp ) target_link_libraries(drivers_board PRIVATE diff --git a/boards/intel/aerofc-v1/src/timer_config.c b/boards/intel/aerofc-v1/src/timer_config.cpp similarity index 73% rename from boards/intel/aerofc-v1/src/timer_config.c rename to boards/intel/aerofc-v1/src/timer_config.cpp index 09b6260707..b4e7278c10 100644 --- a/boards/intel/aerofc-v1/src/timer_config.c +++ b/boards/intel/aerofc-v1/src/timer_config.cpp @@ -32,36 +32,18 @@ * ****************************************************************************/ -/* - * @file timer_config.c - * - * Configuration data for the stm32 pwm_servo, input capture and pwm input driver. - * - * Note that these arrays must always be fully-sized. - */ - -#include - -#include -#include -#include - -#include -#include - -#include "board_config.h" - +#include // Invalidate all timers (base == 0): we don't have any -__EXPORT const io_timers_t io_timers[MAX_IO_TIMERS] = { }; +constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { }; // Invalidate all channels (timer_channel == 0): we don't have any -__EXPORT const timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { }; +constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { }; -__EXPORT const io_timers_channel_mapping_t io_timers_channel_mapping = { }; +constexpr io_timers_channel_mapping_t io_timers_channel_mapping = { }; // Invalidate all timers (base == 0): we don't have any -__EXPORT const struct io_timers_t led_pwm_timers[MAX_LED_TIMERS] = { }; +constexpr io_timers_t led_pwm_timers[MAX_LED_TIMERS] = { }; // Invalidate all channels (timer_channel == 0): we don't have any -__EXPORT const struct timer_io_channels_t led_pwm_channels[MAX_TIMER_LED_CHANNELS] = { }; +constexpr timer_io_channels_t led_pwm_channels[MAX_TIMER_LED_CHANNELS] = { };