mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-31 20:38:27 +08:00
moved uart to mcu_periph/uart
This commit is contained in:
@@ -92,7 +92,7 @@ endif
|
||||
#
|
||||
# Telemetry/Datalink
|
||||
#
|
||||
ap.srcs += $(SRC_ARCH)/uart_hw.c
|
||||
ap.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c
|
||||
ap.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport
|
||||
ap.CFLAGS += -DDOWNLINK_DEVICE=$(MODEM_PORT)
|
||||
ap.srcs += $(SRC_FIRMWARE)/telemetry.c \
|
||||
|
||||
@@ -130,7 +130,7 @@ ns_srcs += $(SRC_ARCH)/sys_time_hw.c
|
||||
# UARTS
|
||||
#
|
||||
|
||||
ns_srcs += $(SRC_ARCH)/uart_hw.c
|
||||
ns_srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c
|
||||
|
||||
#
|
||||
# ANALOG
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
* \brief avr uart low level functions
|
||||
*
|
||||
*/
|
||||
#include "uart.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
#include "sys_time.h"
|
||||
|
||||
#define B2400 2400UL
|
||||
@@ -1,108 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2005 Pascal Brisset, Antoine Drouin
|
||||
*
|
||||
* This file is part of paparazzi.
|
||||
*
|
||||
* paparazzi is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* paparazzi is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with paparazzi; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
/** \file uart_hw.h
|
||||
* \brief avr uart low level headers
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef UART_HW_H
|
||||
#define UART_HW_H
|
||||
|
||||
#include <avr/io.h>
|
||||
#if (__GNUC__ == 3)
|
||||
#include <avr/signal.h>
|
||||
#endif
|
||||
#include <avr/interrupt.h>
|
||||
#include "std.h"
|
||||
|
||||
|
||||
/************************************************************************/
|
||||
#if defined (__AVR_ATmega8__)
|
||||
|
||||
#define ReceiveUart(cb) \
|
||||
SIGNAL( SIG_UART_RECV ) { \
|
||||
uint8_t c = UDR; \
|
||||
cb(c); \
|
||||
}
|
||||
|
||||
#endif /* (__AVR_ATmega8__) */
|
||||
|
||||
|
||||
/************************************************************************/
|
||||
#if defined (__AVR_ATmega128__)
|
||||
|
||||
extern uint8_t tx_buf0[256]; /** For debugging purpose */
|
||||
|
||||
extern void uart0_init_tx(void);
|
||||
extern void uart0_init_rx(void);
|
||||
extern void uart1_init(void);
|
||||
|
||||
extern void uart0_transmit(const uint8_t);
|
||||
extern void uart1_transmit(const uint8_t);
|
||||
|
||||
#define UART0_RX_BUFFER_SIZE 32 // UART0 receive buffer size
|
||||
#define UART1_RX_BUFFER_SIZE 32 // UART1 receive buffer size
|
||||
#define UART0_RX_BUFFER_SIZE_MASK 0x1f
|
||||
#define UART1_RX_BUFFER_SIZE_MASK 0x1f
|
||||
|
||||
#ifdef UART0_RX_BUFFER_SIZE_MASK
|
||||
#define Uart0RxBufferNext(_x) ((_x+1)&UART0_RX_BUFFER_SIZE_MASK)
|
||||
#else
|
||||
#define Uart0RxBufferNext(_x) ((_x+1)%UART0_RX_BUFFER_SIZE)
|
||||
#endif
|
||||
|
||||
#ifdef UART1_RX_BUFFER_SIZE_MASK
|
||||
#define Uart1RxBufferNext(_x) ((_x+1)&UART1_RX_BUFFER_SIZE_MASK)
|
||||
#else
|
||||
#define Uart1RxBufferNext(_x) ((_x+1)%UART1_RX_BUFFER_SIZE)
|
||||
#endif
|
||||
|
||||
|
||||
extern uint16_t uart0_rx_insert_idx, uart0_rx_extract_idx;
|
||||
extern uint8_t uart0_rx_buffer[UART0_RX_BUFFER_SIZE];
|
||||
|
||||
#define Uart0ChAvailable() (uart0_rx_insert_idx != uart0_rx_extract_idx)
|
||||
|
||||
#define Uart0Getch() ({\
|
||||
uint8_t ret = uart0_rx_buffer[uart0_rx_extract_idx]; \
|
||||
uart0_rx_extract_idx = Uart0RxBufferNext(uart0_rx_extract_idx); \
|
||||
ret; \
|
||||
})
|
||||
|
||||
|
||||
extern uint16_t uart1_rx_insert_idx, uart1_rx_extract_idx;
|
||||
extern uint8_t uart1_rx_buffer[UART1_RX_BUFFER_SIZE];
|
||||
|
||||
#define Uart1ChAvailable() (uart1_rx_insert_idx != uart1_rx_extract_idx)
|
||||
|
||||
#define Uart1Getch() ({\
|
||||
uint8_t ret = uart1_rx_buffer[uart1_rx_extract_idx]; \
|
||||
uart1_rx_extract_idx = Uart1RxBufferNext(uart1_rx_extract_idx); \
|
||||
ret; \
|
||||
})
|
||||
|
||||
#endif /* (__AVR_ATmega128__) */
|
||||
|
||||
#endif /* UART_HW_H */
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2008 Pascal Brisset, Antoine Drouin
|
||||
* Copyright (C) 2008-2010 The Paparazzi Team
|
||||
*
|
||||
* This file is part of paparazzi.
|
||||
*
|
||||
@@ -26,7 +26,7 @@
|
||||
* Brief LPC21 uart code
|
||||
*/
|
||||
|
||||
#include "uart.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
#include "armVIC.h"
|
||||
|
||||
#ifdef USE_UART0
|
||||
@@ -22,8 +22,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef UART_HW_H
|
||||
#define UART_HW_H
|
||||
#ifndef LPC21_UART_ARCH_H
|
||||
#define LPC21_UART_ARCH_H
|
||||
|
||||
#include "types.h"
|
||||
#include "LPC21xx.h"
|
||||
@@ -93,4 +93,4 @@ extern void uart0_init_param( uint16_t baud, uint8_t mode, uint8_t fmode);
|
||||
extern uint8_t uart0_tx_running;
|
||||
extern uint8_t uart1_tx_running;
|
||||
|
||||
#endif /* UART_HW_H */
|
||||
#endif /* LPC21_UART_ARCH_H */
|
||||
@@ -26,7 +26,7 @@
|
||||
#define RADIO_CONTROL_SPEKTRUM_ARCH_H
|
||||
|
||||
#include "std.h"
|
||||
#include "uart.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
|
||||
#include RADIO_CONTROL_SPEKTRUM_MODEL_H
|
||||
|
||||
|
||||
@@ -31,12 +31,10 @@
|
||||
*/
|
||||
|
||||
#include "std.h"
|
||||
#include "init_hw.h"
|
||||
#include "mcu.h"
|
||||
#include "sys_time.h"
|
||||
#include "led.h"
|
||||
#include "interrupt_hw.h"
|
||||
#include "uart_hw.h"
|
||||
#include "uart.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
#include "usb_serial.h"
|
||||
|
||||
/* minimum LED blink on time 10Hz = 100ms */
|
||||
@@ -46,21 +44,11 @@ int main( void ) {
|
||||
unsigned char inc;
|
||||
unsigned int rx_time=0, tx_time=0;
|
||||
|
||||
hw_init();
|
||||
mcu_init();
|
||||
sys_time_init();
|
||||
led_init();
|
||||
VCOM_allow_linecoding(1);
|
||||
|
||||
#ifdef USE_UART0
|
||||
Uart0Init();
|
||||
#else
|
||||
#ifdef USE_UART1
|
||||
Uart1Init();
|
||||
#else
|
||||
#error no serial port defined
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef USE_USB_SERIAL
|
||||
VCOM_init();
|
||||
#endif
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
#include <stdbool.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/select.h>
|
||||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
|
||||
#define STDINOUT_BUFFER_SIZE 256
|
||||
#define FD_STDIN 0
|
||||
|
||||
extern char stdinout_buffer[STDINOUT_BUFFER_SIZE];
|
||||
extern uint8_t stdinout_rx_insert_idx;
|
||||
extern uint8_t stdinout_rx_extract_idx;
|
||||
|
||||
|
||||
static inline bool StdInOutChAvailable(void) {
|
||||
struct timeval tv;
|
||||
fd_set fds;
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 0;
|
||||
FD_ZERO(&fds);
|
||||
FD_SET(FD_STDIN, &fds);
|
||||
select(1, &fds, NULL, NULL, &tv);
|
||||
if (FD_ISSET(FD_STDIN, &fds)) {
|
||||
char tmp_buf[STDINOUT_BUFFER_SIZE];
|
||||
uint8_t n = read(FD_STDIN, tmp_buf, STDINOUT_BUFFER_SIZE);
|
||||
unsigned int i;
|
||||
for(i = 0; i < n; i++) {
|
||||
stdinout_buffer[stdinout_rx_insert_idx] = tmp_buf[i];
|
||||
stdinout_rx_insert_idx++; /* Auto overflow */
|
||||
}
|
||||
}
|
||||
return (stdinout_rx_insert_idx != stdinout_rx_extract_idx);
|
||||
}
|
||||
|
||||
#define StdInOutTransmit(_char) putchar(_char)
|
||||
#define StdInOutGetch() ({ \
|
||||
assert(stdinout_rx_insert_idx != stdinout_rx_extract_idx); \
|
||||
stdinout_buffer[stdinout_rx_extract_idx++]; \
|
||||
})
|
||||
@@ -21,7 +21,7 @@
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "uart.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
|
||||
#include <stm32/rcc.h>
|
||||
#include <stm32/misc.h>
|
||||
@@ -282,9 +282,6 @@ volatile uint16_t uart3_tx_insert_idx, uart3_tx_extract_idx;
|
||||
volatile bool_t uart3_tx_running;
|
||||
uint8_t uart3_tx_buffer[UART3_TX_BUFFER_SIZE];
|
||||
|
||||
#include "led.h"
|
||||
|
||||
|
||||
void uart3_init( void ) {
|
||||
|
||||
/* init RCC */
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2009 Antoine Drouin <poinix@gmail.com>
|
||||
* Copyright (C) 2009-2010 The Paparazzi Team
|
||||
*
|
||||
* This file is part of paparazzi.
|
||||
*
|
||||
@@ -26,8 +26,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef UART_HW_H
|
||||
#define UART_HW_H
|
||||
#ifndef STM32_UART_ARCH_H
|
||||
#define STM32_UART_ARCH_H
|
||||
|
||||
#include "std.h"
|
||||
|
||||
@@ -183,4 +183,4 @@ extern uint8_t uart3_tx_buffer[UART3_TX_BUFFER_SIZE];
|
||||
|
||||
void uart_init( void );
|
||||
|
||||
#endif /* UART_HW_H */
|
||||
#endif /* STM32_UART_ARCH_H */
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2010 Antoine Drouin <poinix@gmail.com>
|
||||
* Copyright (C) 2010 The Paparazzi Team
|
||||
*
|
||||
* This file is part of Paparazzi.
|
||||
*
|
||||
@@ -35,28 +35,28 @@
|
||||
#endif
|
||||
|
||||
#if defined USE_UART1 || OVERRIDE_UART1_IRQ_HANDLER
|
||||
#include "uart.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
#define USART1_IRQ_HANDLER usart1_irq_handler
|
||||
#else
|
||||
#define USART1_IRQ_HANDLER null_handler
|
||||
#endif
|
||||
|
||||
#if defined USE_UART2 || OVERRIDE_UART2_IRQ_HANDLER
|
||||
#include "uart.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
#define USART2_IRQ_HANDLER usart2_irq_handler
|
||||
#else
|
||||
#define USART2_IRQ_HANDLER null_handler
|
||||
#endif
|
||||
|
||||
#if defined USE_UART3 || OVERRIDE_UART3_IRQ_HANDLER
|
||||
#include "uart.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
#define USART3_IRQ_HANDLER usart3_irq_handler
|
||||
#else
|
||||
#define USART3_IRQ_HANDLER null_handler
|
||||
#endif
|
||||
|
||||
#if defined USE_UART5 || OVERRIDE_UART5_IRQ_HANDLER
|
||||
#include "uart.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
#define USART5_IRQ_HANDLER usart5_irq_handler
|
||||
#else
|
||||
#define USART5_IRQ_HANDLER null_handler
|
||||
|
||||
@@ -27,10 +27,9 @@
|
||||
#include <stm32/tim.h>
|
||||
#include <stm32/misc.h>
|
||||
#include <stm32/usart.h>
|
||||
#include "uart.h"
|
||||
#include "subsystems/radio_control.h"
|
||||
#include "subsystems/radio_control/spektrum_arch.h"
|
||||
#include "firmwares/rotorcraft/autopilot.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
|
||||
|
||||
#define SPEKTRUM_CHANNELS_PER_FRAME 7
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "uart.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
#include "i2c.h"
|
||||
|
||||
void uart0_init( void ) {}
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include "downlink.h"
|
||||
#include "messages.h"
|
||||
#include "dl_protocol.h"
|
||||
#include "uart.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
|
||||
#ifdef BOOZ_FMS_TYPE
|
||||
#include "booz_fms.h"
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#include "std.h"
|
||||
#include "math/pprz_geodetic_int.h"
|
||||
#include "uart.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
|
||||
struct Booz_gps_state {
|
||||
struct EcefCoor_i ecef_pos; /* pos ECEF in cm */
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "csc_adc.h"
|
||||
#include "csc_ap_link.h"
|
||||
#include <stdio.h>
|
||||
#include "uart.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
#include "print.h"
|
||||
|
||||
#include "LPC21xx.h"
|
||||
|
||||
@@ -28,11 +28,11 @@
|
||||
|
||||
#include "std.h"
|
||||
|
||||
#include "init_hw.h"
|
||||
#include "mcu.h"
|
||||
#include "sys_time.h"
|
||||
#include "led.h"
|
||||
#include "interrupt_hw.h"
|
||||
#include "uart.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
#include "csc_telemetry.h"
|
||||
#include "generated/periodic.h"
|
||||
#include "downlink.h"
|
||||
@@ -66,7 +66,7 @@ struct NedCoor_i booz_ins_gps_speed_cm_s_ned;
|
||||
|
||||
static void csc_main_init( void ) {
|
||||
|
||||
hw_init();
|
||||
mcu_init();
|
||||
sys_time_init();
|
||||
led_init();
|
||||
|
||||
@@ -100,7 +100,7 @@ static void csc_main_init( void ) {
|
||||
#ifdef USE_CSC_THROTTLE
|
||||
csc_throttle_init();
|
||||
#endif
|
||||
int_enable();
|
||||
mcu_int_enable();
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
//#include "downlink.h"
|
||||
//#include "messages.h"
|
||||
#include "uart.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
#include "csc_ap_link.h"
|
||||
//#include "print.h"
|
||||
//#include "com_stats.h"
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
#ifndef DOWNLINK_DEVICE
|
||||
#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
|
||||
#endif
|
||||
#include "uart.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
#include "downlink.h"
|
||||
#include "ap_downlink.h"
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include <math.h>
|
||||
|
||||
#include "estimator.h"
|
||||
#include "uart.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
#include "ap_downlink.h"
|
||||
#include "gps.h"
|
||||
#include "nav.h"
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
#include "commands.h"
|
||||
#include "actuators.h"
|
||||
|
||||
#include "uart.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
#include "firmwares/fixedwing/main_fbw.h"
|
||||
#include "subsystems/radio_control.h"
|
||||
#include "inter_mcu.h"
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
#include "mcu.h"
|
||||
|
||||
#include "led.h"
|
||||
#include "uart.h"
|
||||
#include "spi.h"
|
||||
#include "adc.h"
|
||||
|
||||
|
||||
@@ -78,12 +78,10 @@
|
||||
*/
|
||||
|
||||
#include "std.h"
|
||||
#include "init_hw.h"
|
||||
#include "mcu.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
#include "sys_time.h"
|
||||
#include "led.h"
|
||||
#include "interrupt_hw.h"
|
||||
#include "uart_hw.h"
|
||||
#include "uart.h"
|
||||
|
||||
#include "usb_msc_hw.h"
|
||||
|
||||
@@ -513,17 +511,10 @@ int main(void)
|
||||
}
|
||||
|
||||
static inline void main_init( void ) {
|
||||
hw_init();
|
||||
mcu_init();
|
||||
sys_time_init();
|
||||
led_init();
|
||||
|
||||
#ifdef USE_UART0
|
||||
Uart0Init();
|
||||
#endif
|
||||
#ifdef USE_UART1
|
||||
Uart1Init();
|
||||
#endif
|
||||
|
||||
#ifdef USE_MAX11040
|
||||
max11040_init_ssp();
|
||||
max11040_init();
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
|
||||
#include "std.h"
|
||||
#include "init_hw.h"
|
||||
#include "mcu.h"
|
||||
#include "sys_time.h"
|
||||
#include "led.h"
|
||||
#include "interrupt_hw.h"
|
||||
#include "mb_tacho.h"
|
||||
#include "mb_servo.h"
|
||||
#include "i2c.h"
|
||||
@@ -13,7 +12,7 @@
|
||||
#include "mb_scale.h"
|
||||
|
||||
|
||||
#include "uart.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
#include "messages.h"
|
||||
#include "downlink.h"
|
||||
|
||||
@@ -42,7 +41,7 @@ int main( void ) {
|
||||
|
||||
static inline void main_init( void ) {
|
||||
|
||||
hw_init();
|
||||
mcu_init();
|
||||
led_init();
|
||||
sys_time_init();
|
||||
mb_tacho_init();
|
||||
@@ -62,7 +61,7 @@ static inline void main_init( void ) {
|
||||
uart0_init();
|
||||
mb_mode_init();
|
||||
|
||||
int_enable();
|
||||
mcu_int_enable();
|
||||
}
|
||||
|
||||
static inline void main_periodic_task( void ) {
|
||||
|
||||
@@ -306,7 +306,7 @@ void nav_periodic_task() {
|
||||
|
||||
#include "downlink.h"
|
||||
#include "messages.h"
|
||||
#include "uart.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
void nav_move_waypoint(uint8_t wp_id, struct EnuCoor_i * new_pos) {
|
||||
if (wp_id < nb_waypoint) {
|
||||
INT32_VECT3_COPY(waypoints[wp_id],(*new_pos));
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#include "std.h"
|
||||
#include "messages.h"
|
||||
#include "uart.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
|
||||
#include "downlink.h"
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "std.h"
|
||||
#include "init_hw.h"
|
||||
#include "interrupt_hw.h"
|
||||
#include "mcu.h"
|
||||
#include "sys_time.h"
|
||||
#include "led.h"
|
||||
#include "firmwares/fixedwing/actuators.h"
|
||||
@@ -8,7 +7,7 @@
|
||||
#include "generated/airframe.h"
|
||||
#define DATALINK_C
|
||||
#include "datalink.h"
|
||||
#include "uart.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
#include "pprz_transport.h"
|
||||
#include "firmwares/fixedwing/main_fbw.h"
|
||||
#include "downlink.h"
|
||||
@@ -48,7 +47,7 @@ void dl_parse_msg( void ) {
|
||||
#define PprzUartInit() Link(Init())
|
||||
|
||||
void init_fbw( void ) {
|
||||
hw_init();
|
||||
mcu_init();
|
||||
sys_time_init();
|
||||
led_init();
|
||||
|
||||
@@ -63,7 +62,7 @@ void init_fbw( void ) {
|
||||
|
||||
// SetServo(SERVO_GAZ, SERVO_GAZ_MIN);
|
||||
|
||||
int_enable();
|
||||
mcu_int_enable();
|
||||
}
|
||||
|
||||
void periodic_task_fbw(void) {
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
|
||||
#include "std.h"
|
||||
#include "init_hw.h"
|
||||
#include "mcu.h"
|
||||
#include "sys_time.h"
|
||||
#include "led.h"
|
||||
#include "interrupt_hw.h"
|
||||
#include "uart.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
#include "print.h"
|
||||
|
||||
static inline void main_init( void );
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
#include "std.h"
|
||||
#include "init_hw.h"
|
||||
#include "mcu.h"
|
||||
#include "sys_time.h"
|
||||
#include "led.h"
|
||||
#include "interrupt_hw.h"
|
||||
#include "uart.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
|
||||
#include "messages.h"
|
||||
#include "downlink.h"
|
||||
@@ -21,11 +20,11 @@ int main( void ) {
|
||||
}
|
||||
|
||||
static inline void main_init( void ) {
|
||||
hw_init();
|
||||
mcu_init();
|
||||
sys_time_init();
|
||||
led_init();
|
||||
uart0_init_tx();
|
||||
int_enable();
|
||||
mcu_int_enable();
|
||||
}
|
||||
|
||||
static inline void main_periodic_task( void ) {
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
#include "std.h"
|
||||
#include "init_hw.h"
|
||||
#include "mcu.h"
|
||||
#include "sys_time.h"
|
||||
#include "led.h"
|
||||
#include "interrupt_hw.h"
|
||||
#include "uart.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
|
||||
#include "messages.h"
|
||||
#include "downlink.h"
|
||||
@@ -25,11 +24,11 @@ int main( void ) {
|
||||
}
|
||||
|
||||
static inline void main_init( void ) {
|
||||
hw_init();
|
||||
mcu_init();
|
||||
sys_time_init();
|
||||
led_init();
|
||||
uart0_init_tx();
|
||||
int_enable();
|
||||
mcu_int_enable();
|
||||
}
|
||||
|
||||
static inline void main_periodic_task( void ) {
|
||||
|
||||
+2
-2
@@ -106,7 +106,7 @@ struct svinfo {
|
||||
extern struct svinfo gps_svinfos[GPS_NB_CHANNELS];
|
||||
|
||||
#ifndef SITL
|
||||
#include "uart.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
|
||||
#define __GpsLink(dev, _x) dev##_x
|
||||
#define _GpsLink(dev, _x) __GpsLink(dev, _x)
|
||||
@@ -128,7 +128,7 @@ extern struct svinfo gps_svinfos[GPS_NB_CHANNELS];
|
||||
#define GpsToggleLed() {}
|
||||
#endif
|
||||
|
||||
#if defined(GPS) || defined(USE_GPS_XSENS) || defined(SITL)
|
||||
#if defined(USE_GPS) || defined(USE_GPS_XSENS) || defined(SITL)
|
||||
# define GpsTimeoutError (cpu_time_sec - last_gps_msg_t > FAILSAFE_DELAY_WITHOUT_GPS)
|
||||
#else
|
||||
# define GpsTimeoutError 1
|
||||
|
||||
@@ -43,9 +43,8 @@
|
||||
|
||||
|
||||
#include "generated/flight_plan.h"
|
||||
#include "uart.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
#include "gps.h"
|
||||
//include "gps_ubx.h"
|
||||
#include "nav.h"
|
||||
#include "latlong.h"
|
||||
|
||||
@@ -98,8 +97,6 @@ void ubxsend_cfg_rst(uint16_t bbr , uint8_t reset_mode) {
|
||||
#ifdef GPS_CONFIGURE
|
||||
/* GPS dynamic configuration */
|
||||
|
||||
#include "uart.h"
|
||||
|
||||
void gps_configure_uart ( void ) {
|
||||
//UbxSend_CFG_PRT(0x01, 0x0, 0x0, 0x000008D0, GPS_BAUD, UBX_PROTO_MASK, UBX_PROTO_MASK, 0x0, 0x0);
|
||||
//while (GpsUartRunning) ; /* FIXME */
|
||||
|
||||
@@ -35,10 +35,10 @@
|
||||
#include <stdio.h>
|
||||
//for baudrate
|
||||
#include "fms_serial_port.h"
|
||||
#endif
|
||||
#endif /* FMS_PERIODIC_FREQ */
|
||||
|
||||
#include "generated/flight_plan.h"
|
||||
#include "uart.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
#include "gps.h"
|
||||
#include "gps_ubx.h"
|
||||
#include "nav.h"
|
||||
@@ -152,7 +152,6 @@ void gps_init( void ) {
|
||||
#ifdef GPS_CONFIGURE
|
||||
/* GPS dynamic configuration */
|
||||
|
||||
#include "uart.h"
|
||||
|
||||
#ifndef GPS_PORT_ID
|
||||
#define GPS_PORT_ID GPS_PORT_UART1
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include "sys_time.h"
|
||||
#include "generated/airframe.h"
|
||||
|
||||
#include "uart.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
#include "messages.h"
|
||||
#include "downlink.h"
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "lisa/lisa_overo_link.h"
|
||||
#include "lisa/lisa_spistream.h"
|
||||
#include "generated/airframe.h"
|
||||
#include "uart.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
|
||||
static inline void main_init(void);
|
||||
static inline void main_periodic(void);
|
||||
|
||||
@@ -24,16 +24,15 @@
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "std.h"
|
||||
#include "init_hw.h"
|
||||
#include "mcu.h"
|
||||
#include "sys_time.h"
|
||||
#include "led.h"
|
||||
#include "uart.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
#include "messages.h"
|
||||
#include "downlink.h"
|
||||
|
||||
#include "subsystems/imu.h"
|
||||
|
||||
#include "interrupt_hw.h"
|
||||
|
||||
#ifndef MEASURED_SENSOR
|
||||
#define MEASURED_SENSOR gyro_unscaled.p
|
||||
@@ -60,11 +59,11 @@ int main( void ) {
|
||||
|
||||
static inline void main_init( void ) {
|
||||
|
||||
hw_init();
|
||||
mcu_init();
|
||||
sys_time_init();
|
||||
imu_init();
|
||||
|
||||
int_enable();
|
||||
mcu_int_enable();
|
||||
}
|
||||
|
||||
static inline void main_periodic_task( void ) {
|
||||
|
||||
@@ -24,10 +24,10 @@
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "std.h"
|
||||
#include "init_hw.h"
|
||||
#include "mcu.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
#include "sys_time.h"
|
||||
#include "led.h"
|
||||
#include "uart.h"
|
||||
|
||||
static inline void main_init( void );
|
||||
static inline void main_periodic_task( void );
|
||||
|
||||
@@ -29,11 +29,11 @@
|
||||
#include "test_board.h"
|
||||
|
||||
#include "std.h"
|
||||
#include "init_hw.h"
|
||||
#include "mcu.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
#include "sys_time.h"
|
||||
#include "downlink.h"
|
||||
#include "led.h"
|
||||
#include "uart.h"
|
||||
|
||||
#include "datalink.h"
|
||||
#include "generated/settings.h"
|
||||
|
||||
@@ -50,6 +50,8 @@ static inline void main_periodic( void ) {
|
||||
static float foo = 0.;
|
||||
foo += 0.0025;
|
||||
int32_t bar = 1500 + 500. * sin(foo);
|
||||
// int32_t bar = 1450;
|
||||
// int32_t bar = 1950;
|
||||
actuators_pwm_values[0] = bar;
|
||||
actuators_pwm_values[1] = bar;
|
||||
actuators_pwm_values[2] = bar;
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@
|
||||
#endif
|
||||
#endif
|
||||
#if defined USE_UART0 || defined USE_UART1 || defined USE_UART2 || defined USE_UART3 || defined USE_UART4 || defined USE_UART5
|
||||
#include "uart.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
#endif
|
||||
#if defined USE_I2C1 || defined USE_I2C2
|
||||
#include "i2c.h"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Paparazzi $Id$
|
||||
*
|
||||
* Copyright (C) 2006 Pascal Brisset, Antoine Drouin
|
||||
* Copyright (C) 2010 The Paparazzi Team
|
||||
*
|
||||
* This file is part of paparazzi.
|
||||
*
|
||||
@@ -22,15 +22,15 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/** \file uart.h
|
||||
/** \file mcu_periph/uart.h
|
||||
* \brief arch independant UART (Universal Asynchronous Receiver/Transmitter) API
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef UART_H
|
||||
#define UART_H
|
||||
#ifndef MCU_PERIPH_UART_H
|
||||
#define MCU_PERIPH_UART_H
|
||||
|
||||
#include "uart_hw.h"
|
||||
#include "mcu_periph/uart_arch.h"
|
||||
#include "std.h"
|
||||
|
||||
|
||||
@@ -121,4 +121,4 @@ extern bool_t uart3_check_free_space( uint8_t len);
|
||||
|
||||
#endif /* USE_UART3 */
|
||||
|
||||
#endif /* UART_H */
|
||||
#endif /* MCU_PERIPH_UART_H */
|
||||
@@ -53,7 +53,7 @@ struct i2c_transaction mppt_trans;
|
||||
#ifndef DOWNLINK_DEVICE
|
||||
#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
|
||||
#endif
|
||||
#include "uart.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
#include "messages.h"
|
||||
#include "downlink.h"
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "adc_generic.h"
|
||||
#include "adc.h"
|
||||
#include "uart.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
#include "messages.h"
|
||||
#include "downlink.h"
|
||||
#include BOARD_CONFIG
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
*/
|
||||
|
||||
#include "led.h"
|
||||
#include "uart.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
#include "messages.h"
|
||||
#include "downlink.h"
|
||||
#include "max11040.h"
|
||||
|
||||
@@ -45,7 +45,7 @@ extern volatile uint8_t cam_msg_received;
|
||||
extern void parse_cam_msg( void );
|
||||
extern void parse_cam_buffer( uint8_t );
|
||||
|
||||
#include "uart.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
|
||||
#define __CamLink(dev, _x) dev##_x
|
||||
#define _CamLink(dev, _x) __CamLink(dev, _x)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
#include <inttypes.h>
|
||||
#include "extra_pprz_dl.h"
|
||||
#include "uart.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
|
||||
volatile bool_t extra_pprz_msg_received = FALSE;
|
||||
uint8_t extra_pprz_ovrn, extra_pprz_error;
|
||||
|
||||
@@ -57,7 +57,7 @@ void init_sysmon(void) {
|
||||
sum_n_event = 0;
|
||||
}
|
||||
|
||||
#include "uart.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
#include "messages.h"
|
||||
#ifndef DOWNLINK_DEVICE
|
||||
#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#ifndef DOWNLINK_DEVICE
|
||||
#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
|
||||
#endif
|
||||
#include "uart.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
#include "messages.h"
|
||||
#include "downlink.h"
|
||||
#include "estimator.h"
|
||||
|
||||
@@ -38,7 +38,7 @@ uint16_t dc_photo_nr = 0;
|
||||
#ifndef DOWNLINK_DEVICE
|
||||
#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
|
||||
#endif
|
||||
#include "uart.h"
|
||||
#include "mcu_periph/uart.h"
|
||||
#include "messages.h"
|
||||
#include "downlink.h"
|
||||
#include "estimator.h"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user