av/x-v1: use hw description methods for timer configuration

This commit is contained in:
Beat Küng
2020-01-28 19:26:31 +01:00
committed by David Sidrane
parent 366e2b9dc9
commit ebbcc01f12
5 changed files with 67 additions and 283 deletions

View File

@@ -66,6 +66,7 @@
#include <arch/board/board.h>
#include "up_internal.h"
#include <px4_arch/io_timer.h>
#include <drivers/drv_hrt.h>
#include <drivers/drv_board_led.h>
#include <systemlib/px4_macros.h>
@@ -88,10 +89,9 @@ static int configure_switch(void);
************************************************************************************/
__EXPORT void board_on_reset(int status)
{
/* configure the GPIO pins to outputs and keep them low */
const uint32_t gpio[] = PX4_GPIO_PWM_INIT_LIST;
px4_gpio_init(gpio, arraySize(gpio));
for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) {
px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i)));
}
if (status >= 0) {
up_mdelay(6);