forked from Archive/PX4-Autopilot
boards: remove DIRECT_INPUT_TIMER_CHANNELS from board_config.h
This commit is contained in:
parent
ae8733c2d4
commit
c5c80e31b6
|
@ -95,7 +95,6 @@
|
|||
/* AUX PWMs
|
||||
*/
|
||||
#define DIRECT_PWM_OUTPUT_CHANNELS 8
|
||||
#define DIRECT_INPUT_TIMER_CHANNELS 8
|
||||
|
||||
/* USB OTG FS
|
||||
*
|
||||
|
|
|
@ -101,7 +101,6 @@
|
|||
/* PWM
|
||||
*/
|
||||
#define DIRECT_PWM_OUTPUT_CHANNELS 9
|
||||
#define DIRECT_INPUT_TIMER_CHANNELS 9
|
||||
|
||||
#define BOARD_CAPTURE_GPIO /* PD14 */ (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|GPIO_PORTD|GPIO_PIN14)
|
||||
|
||||
|
|
|
@ -47,8 +47,6 @@
|
|||
#include <nuttx/compiler.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <px4_platform_common/board_common.h>
|
||||
|
||||
/******************************************************************************
|
||||
* Definitions
|
||||
******************************************************************************/
|
||||
|
@ -135,6 +133,7 @@
|
|||
#define GPIO_PWM8 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN1)
|
||||
|
||||
#define DIRECT_PWM_OUTPUT_CHANNELS 8
|
||||
#define BOARD_HAS_NO_CAPTURE
|
||||
|
||||
/* SBUS pins *************************************************************/
|
||||
|
||||
|
@ -166,3 +165,6 @@
|
|||
#define BOARD_NUM_IO_TIMERS 3
|
||||
|
||||
#define BOARD_DISABLE_I2C_SPI
|
||||
|
||||
|
||||
#include <px4_platform_common/board_common.h>
|
||||
|
|
|
@ -202,7 +202,6 @@
|
|||
/* PWM
|
||||
*/
|
||||
#define DIRECT_PWM_OUTPUT_CHANNELS 5
|
||||
#define DIRECT_INPUT_TIMER_CHANNELS 5
|
||||
|
||||
#define BOARD_DSHOT_MOTOR_ASSIGNMENT {3, 2, 1, 0, 4};
|
||||
|
||||
|
|
|
@ -100,7 +100,6 @@
|
|||
/* PWM
|
||||
*/
|
||||
#define DIRECT_PWM_OUTPUT_CHANNELS 6
|
||||
#define DIRECT_INPUT_TIMER_CHANNELS 6
|
||||
|
||||
/* Tone alarm output */
|
||||
#define GPIO_TONE_ALARM_IDLE /* PD15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN15)
|
||||
|
|
|
@ -239,7 +239,6 @@
|
|||
/* PWM
|
||||
*/
|
||||
#define DIRECT_PWM_OUTPUT_CHANNELS 8
|
||||
#define DIRECT_INPUT_TIMER_CHANNELS 8
|
||||
|
||||
#define BOARD_HAS_LED_PWM 1
|
||||
#define BOARD_LED_PWM_DRIVE_ACTIVE_LOW 1
|
||||
|
|
|
@ -150,7 +150,6 @@
|
|||
*/
|
||||
|
||||
#define DIRECT_PWM_OUTPUT_CHANNELS 8
|
||||
#define DIRECT_INPUT_TIMER_CHANNELS 8
|
||||
|
||||
#define GPIO_CAN1_SILENT /* PI11 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTI|GPIO_PIN11)
|
||||
|
||||
|
|
|
@ -209,7 +209,6 @@
|
|||
/* PWM
|
||||
*/
|
||||
#define DIRECT_PWM_OUTPUT_CHANNELS 8
|
||||
#define DIRECT_INPUT_TIMER_CHANNELS 8
|
||||
|
||||
#define BOARD_DSHOT_MOTOR_ASSIGNMENT {3, 2, 1, 0, 4, 5, 6, 7};
|
||||
|
||||
|
|
|
@ -108,7 +108,6 @@
|
|||
|
||||
/* PWM */
|
||||
#define DIRECT_PWM_OUTPUT_CHANNELS 8
|
||||
#define DIRECT_INPUT_TIMER_CHANNELS 8
|
||||
|
||||
/* Power supply control and monitoring GPIOs */
|
||||
#define GPIO_nPOWER_IN_A /* PB5 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN5)
|
||||
|
|
|
@ -107,7 +107,6 @@
|
|||
|
||||
/* PWM */
|
||||
#define DIRECT_PWM_OUTPUT_CHANNELS 8
|
||||
#define DIRECT_INPUT_TIMER_CHANNELS 8
|
||||
|
||||
/* Power supply control and monitoring GPIOs */
|
||||
#define GPIO_nPOWER_IN_A /* PB5 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN5)
|
||||
|
|
|
@ -81,7 +81,6 @@
|
|||
|
||||
/* PWM */
|
||||
#define DIRECT_PWM_OUTPUT_CHANNELS 8
|
||||
#define DIRECT_INPUT_TIMER_CHANNELS 8
|
||||
|
||||
/* Power supply control and monitoring GPIOs */
|
||||
#define GPIO_nPOWER_IN_A /* PB5 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN5)
|
||||
|
|
|
@ -80,7 +80,6 @@
|
|||
|
||||
/* PWM */
|
||||
#define DIRECT_PWM_OUTPUT_CHANNELS 8
|
||||
#define DIRECT_INPUT_TIMER_CHANNELS 8
|
||||
|
||||
/* Power supply control and monitoring GPIOs */
|
||||
#define GPIO_nPOWER_IN_A /* PB5 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN5)
|
||||
|
|
|
@ -84,7 +84,6 @@
|
|||
|
||||
/* PWM */
|
||||
#define DIRECT_PWM_OUTPUT_CHANNELS 8
|
||||
#define DIRECT_INPUT_TIMER_CHANNELS 8
|
||||
|
||||
/* Power supply control and monitoring GPIOs */
|
||||
#define GPIO_nPOWER_IN_A /* PB5 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN5)
|
||||
|
|
|
@ -91,7 +91,6 @@
|
|||
|
||||
/* PWM */
|
||||
#define DIRECT_PWM_OUTPUT_CHANNELS 6
|
||||
#define DIRECT_INPUT_TIMER_CHANNELS 6
|
||||
|
||||
/* USB OTG FS
|
||||
*
|
||||
|
|
|
@ -102,7 +102,6 @@
|
|||
/* PWM
|
||||
*/
|
||||
#define DIRECT_PWM_OUTPUT_CHANNELS 6
|
||||
#define DIRECT_INPUT_TIMER_CHANNELS 6
|
||||
|
||||
/* USB OTG FS
|
||||
*
|
||||
|
|
|
@ -270,7 +270,6 @@ __END_DECLS
|
|||
// todo:Design this!
|
||||
|
||||
#define DIRECT_PWM_OUTPUT_CHANNELS 8
|
||||
#define DIRECT_INPUT_TIMER_CHANNELS 8
|
||||
|
||||
#define GPIO_ULTRASOUND_TRIGGER /* PTD0 */ (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTD | PIN0)
|
||||
#define GPIO_ULTRASOUND_ECHO /* PTA10 */ (GPIO_PULLUP | PIN_INT_BOTH | PIN_PORTA | PIN10)
|
||||
|
|
|
@ -274,7 +274,6 @@ __END_DECLS
|
|||
// todo:Design this!
|
||||
|
||||
#define DIRECT_PWM_OUTPUT_CHANNELS 6
|
||||
#define DIRECT_INPUT_TIMER_CHANNELS 6
|
||||
|
||||
#define GPIO_ULTRASOUND_TRIGGER /* PTD0 */ (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTD | PIN0)
|
||||
#define GPIO_ULTRASOUND_ECHO /* PTA10 */ (GPIO_PULLUP | PIN_INT_BOTH | PIN_PORTA | PIN10)
|
||||
|
|
|
@ -241,7 +241,7 @@
|
|||
|
||||
// Input Capture not supported on MVP
|
||||
|
||||
#define DIRECT_INPUT_TIMER_CHANNELS 0
|
||||
#define BOARD_HAS_NO_CAPTURE
|
||||
|
||||
//#define BOARD_HAS_UI_LED_PWM 1 Not ported yet (Still Kinetis driver)
|
||||
#define BOARD_HAS_LED_PWM 1
|
||||
|
|
|
@ -119,7 +119,6 @@
|
|||
* Alternatively CH3/CH4 could be assigned to UART6_TX/RX
|
||||
*/
|
||||
#define DIRECT_PWM_OUTPUT_CHANNELS 4
|
||||
#define DIRECT_INPUT_TIMER_CHANNELS 4
|
||||
|
||||
/* High-resolution timer */
|
||||
#define HRT_TIMER 4 // T4C1
|
||||
|
|
|
@ -131,7 +131,6 @@
|
|||
/* PWM
|
||||
*/
|
||||
#define DIRECT_PWM_OUTPUT_CHANNELS 6
|
||||
#define DIRECT_INPUT_TIMER_CHANNELS 6
|
||||
|
||||
/* USB OTG FS
|
||||
*
|
||||
|
|
|
@ -131,7 +131,6 @@
|
|||
/* PWM
|
||||
*/
|
||||
#define DIRECT_PWM_OUTPUT_CHANNELS 6
|
||||
#define DIRECT_INPUT_TIMER_CHANNELS 6
|
||||
|
||||
/* USB OTG FS
|
||||
*
|
||||
|
|
|
@ -104,7 +104,6 @@
|
|||
* Six PWM outputs are configured.
|
||||
*/
|
||||
#define DIRECT_PWM_OUTPUT_CHANNELS 6
|
||||
#define DIRECT_INPUT_TIMER_CHANNELS 6
|
||||
|
||||
/**
|
||||
* USB OTG FS:
|
||||
|
|
|
@ -148,7 +148,6 @@
|
|||
/* PWM
|
||||
*/
|
||||
#define DIRECT_PWM_OUTPUT_CHANNELS 6
|
||||
#define DIRECT_INPUT_TIMER_CHANNELS 6
|
||||
|
||||
/* USB OTG FS
|
||||
*
|
||||
|
|
|
@ -240,7 +240,6 @@
|
|||
/* PWM
|
||||
*/
|
||||
#define DIRECT_PWM_OUTPUT_CHANNELS 8
|
||||
#define DIRECT_INPUT_TIMER_CHANNELS 8
|
||||
|
||||
#define BOARD_HAS_LED_PWM 1
|
||||
#define BOARD_LED_PWM_DRIVE_ACTIVE_LOW 1
|
||||
|
|
|
@ -231,7 +231,6 @@
|
|||
/* PWM
|
||||
*/
|
||||
#define DIRECT_PWM_OUTPUT_CHANNELS 8
|
||||
#define DIRECT_INPUT_TIMER_CHANNELS 8
|
||||
|
||||
#define BOARD_DSHOT_MOTOR_ASSIGNMENT {3, 2, 1, 0, 4, 5, 6, 7};
|
||||
|
||||
|
|
|
@ -217,7 +217,6 @@
|
|||
/* PWM
|
||||
*/
|
||||
#define DIRECT_PWM_OUTPUT_CHANNELS 8
|
||||
#define DIRECT_INPUT_TIMER_CHANNELS 8
|
||||
|
||||
#define BOARD_DSHOT_MOTOR_ASSIGNMENT {3, 2, 1, 0, 4, 5, 6, 7};
|
||||
|
||||
|
|
|
@ -257,7 +257,6 @@
|
|||
/* PWM
|
||||
*/
|
||||
#define DIRECT_PWM_OUTPUT_CHANNELS 8
|
||||
#define DIRECT_INPUT_TIMER_CHANNELS 8
|
||||
|
||||
#define BOARD_DSHOT_MOTOR_ASSIGNMENT {3, 2, 1, 0, 4, 5, 6, 7};
|
||||
|
||||
|
|
|
@ -47,8 +47,6 @@
|
|||
#include <nuttx/compiler.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <px4_platform_common/board_common.h>
|
||||
|
||||
/******************************************************************************
|
||||
* Definitions
|
||||
******************************************************************************/
|
||||
|
@ -135,6 +133,7 @@
|
|||
#define GPIO_PWM8 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN1)
|
||||
|
||||
#define DIRECT_PWM_OUTPUT_CHANNELS 8
|
||||
#define BOARD_HAS_NO_CAPTURE
|
||||
|
||||
/* SBUS pins *************************************************************/
|
||||
|
||||
|
@ -166,3 +165,5 @@
|
|||
#define BOARD_NUM_IO_TIMERS 3
|
||||
|
||||
#define BOARD_DISABLE_I2C_SPI
|
||||
|
||||
#include <px4_platform_common/board_common.h>
|
||||
|
|
|
@ -96,7 +96,6 @@
|
|||
/* PWM
|
||||
*/
|
||||
#define DIRECT_PWM_OUTPUT_CHANNELS 8
|
||||
#define DIRECT_INPUT_TIMER_CHANNELS 8
|
||||
|
||||
/* Tone alarm output */
|
||||
#define GPIO_TONE_ALARM_IDLE /* PE5 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN5)
|
||||
|
|
|
@ -101,7 +101,6 @@
|
|||
* PWM
|
||||
*/
|
||||
#define DIRECT_PWM_OUTPUT_CHANNELS 6
|
||||
#define DIRECT_INPUT_TIMER_CHANNELS 6
|
||||
|
||||
/**
|
||||
* USB OTG FS:
|
||||
|
|
|
@ -240,13 +240,6 @@
|
|||
# define BOARD_EEPROM_WP_CTRL(on_true)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Defined when a board has capture and uses channels.
|
||||
*/
|
||||
#if defined(DIRECT_INPUT_TIMER_CHANNELS) && DIRECT_INPUT_TIMER_CHANNELS > 0
|
||||
#define BOARD_HAS_CAPTURE 1
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Defined when a supports version and type API.
|
||||
*/
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
#include <stm32_gpio.h>
|
||||
#include <stm32_tim.h>
|
||||
|
||||
#if defined(BOARD_HAS_CAPTURE)
|
||||
#if !defined(BOARD_HAS_NO_CAPTURE)
|
||||
|
||||
/* Support Input capture */
|
||||
|
||||
|
@ -497,4 +497,4 @@ int up_input_capture_get_stats(unsigned channel, input_capture_stats_t *stats, b
|
|||
|
||||
return rv;
|
||||
}
|
||||
#endif // defined(BOARD_HAS_CAPTURE)
|
||||
#endif // !defined(BOARD_HAS_NO_CAPTURE)
|
||||
|
|
|
@ -156,7 +156,7 @@ typedef uint8_t io_timer_allocation_t; /* big enough to hold MAX_IO_TIMERS */
|
|||
|
||||
io_timer_channel_allocation_t timer_allocations[MAX_IO_TIMERS] = { };
|
||||
|
||||
#if defined(BOARD_HAS_CAPTURE)
|
||||
#if !defined(BOARD_HAS_NO_CAPTURE)
|
||||
|
||||
/* Stats and handlers are only useful for Capture */
|
||||
|
||||
|
@ -171,12 +171,12 @@ static struct channel_handler_entry {
|
|||
channel_handler_t callback;
|
||||
void *context;
|
||||
} channel_handlers[MAX_TIMER_IO_CHANNELS];
|
||||
#endif // defined(BOARD_HAS_CAPTURE)
|
||||
#endif // !defined(BOARD_HAS_NO_CAPTURE)
|
||||
|
||||
|
||||
static int io_timer_handler(uint16_t timer_index)
|
||||
{
|
||||
#if defined(BOARD_HAS_CAPTURE)
|
||||
#if !defined(BOARD_HAS_NO_CAPTURE)
|
||||
/* Read the count at the time of the interrupt */
|
||||
|
||||
uint16_t count = rCNT(timer_index);
|
||||
|
@ -231,7 +231,7 @@ static int io_timer_handler(uint16_t timer_index)
|
|||
/* Clear all the SR bits for interrupt enabled channels only */
|
||||
|
||||
rSR(timer_index) = ~(statusr & (enabled | enabled << 8));
|
||||
#endif // defined(BOARD_HAS_CAPTURE)
|
||||
#endif // !defined(BOARD_HAS_NO_CAPTURE)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -773,7 +773,7 @@ int io_timer_channel_init(unsigned channel, io_timer_channel_mode_t mode,
|
|||
gpio = timer_io_channels[channel].gpio_in;
|
||||
break;
|
||||
|
||||
#if defined(BOARD_HAS_CAPTURE)
|
||||
#if !defined(BOARD_HAS_NO_CAPTURE)
|
||||
|
||||
case IOTimerChanMode_Capture:
|
||||
setbits = CCMR_C1_CAPTURE_INIT;
|
||||
|
@ -851,7 +851,7 @@ int io_timer_channel_init(unsigned channel, io_timer_channel_mode_t mode,
|
|||
rvalue |= setbits;
|
||||
rCCER(timer) = rvalue;
|
||||
|
||||
#if !defined(BOARD_HAS_CAPTURE)
|
||||
#if defined(BOARD_HAS_NO_CAPTURE)
|
||||
UNUSED(dier_setbits);
|
||||
#else
|
||||
channel_handlers[channel].callback = channel_handler;
|
||||
|
|
Loading…
Reference in New Issue