mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-10 06:59:54 +08:00
remove obsolete link macros
This commit is contained in:
@@ -48,7 +48,7 @@
|
||||
<define name="DM_LOG_SPI_DEV" value="$(DM_LOG_SPI_DEV_LOWER)" />
|
||||
<define name="DM_LOG_SPI_SLAVE_IDX" value="$(DM_LOG_SPI_SLAVE_IDX_UPPER)" />
|
||||
|
||||
<define name="DM_LOG_UART" value="$(DM_LOG_UART_UPPER)"/>
|
||||
<define name="DM_LOG_UART" value="$(DM_LOG_UART_LOWER)"/>
|
||||
<define name="USE_$(DM_LOG_UART_UPPER)"/>
|
||||
<define name="$(DM_LOG_UART_UPPER)_BAUD" value="B230400"/>
|
||||
|
||||
|
||||
@@ -96,113 +96,36 @@ extern uint16_t uart_char_available(struct uart_periph *p);
|
||||
#if USE_UART0
|
||||
extern struct uart_periph uart0;
|
||||
extern void uart0_init(void);
|
||||
|
||||
#define UART0Init() uart_periph_init(&uart0)
|
||||
#define UART0CheckFreeSpace(_x) uart_check_free_space(&uart0, _x)
|
||||
#define UART0Transmit(_x) uart_transmit(&uart0, _x)
|
||||
#define UART0SendMessage() {}
|
||||
#define UART0ChAvailable() uart_char_available(&uart0)
|
||||
#define UART0Getch() uart_getch(&uart0)
|
||||
#define UART0TxRunning uart0.tx_running
|
||||
#define UART0SetBaudrate(_b) uart_periph_set_baudrate(&uart0, _b)
|
||||
#define UART0SetBitsStopParity(_b, _s, _p) uart_periph_set_bits_stop_parity(&uart0, _b, _s, _p)
|
||||
|
||||
#endif // USE_UART0
|
||||
|
||||
#if USE_UART1
|
||||
extern struct uart_periph uart1;
|
||||
extern void uart1_init(void);
|
||||
|
||||
#define UART1Init() uart_periph_init(&uart1)
|
||||
#define UART1CheckFreeSpace(_x) uart_check_free_space(&uart1, _x)
|
||||
#define UART1Transmit(_x) uart_transmit(&uart1, _x)
|
||||
#define UART1SendMessage() {}
|
||||
#define UART1ChAvailable() uart_char_available(&uart1)
|
||||
#define UART1Getch() uart_getch(&uart1)
|
||||
#define UART1TxRunning uart1.tx_running
|
||||
#define UART1SetBaudrate(_b) uart_periph_set_baudrate(&uart1, _b)
|
||||
#define UART1SetBitsStopParity(_b, _s, _p) uart_periph_set_bits_stop_parity(&uart1, _b, _s, _p)
|
||||
|
||||
#endif // USE_UART1
|
||||
|
||||
#if USE_UART2
|
||||
extern struct uart_periph uart2;
|
||||
extern void uart2_init(void);
|
||||
|
||||
#define UART2Init() uart_periph_init(&uart2)
|
||||
#define UART2CheckFreeSpace(_x) uart_check_free_space(&uart2, _x)
|
||||
#define UART2Transmit(_x) uart_transmit(&uart2, _x)
|
||||
#define UART2SendMessage() {}
|
||||
#define UART2ChAvailable() uart_char_available(&uart2)
|
||||
#define UART2Getch() uart_getch(&uart2)
|
||||
#define UART2TxRunning uart2.tx_running
|
||||
#define UART2SetBaudrate(_b) uart_periph_set_baudrate(&uart2, _b)
|
||||
#define UART2SetBitsStopParity(_b, _s, _p) uart_periph_set_bits_stop_parity(&uart2, _b, _s, _p)
|
||||
|
||||
#endif // USE_UART2
|
||||
|
||||
#if USE_UART3
|
||||
extern struct uart_periph uart3;
|
||||
extern void uart3_init(void);
|
||||
|
||||
#define UART3Init() uart_periph_init(&uart3)
|
||||
#define UART3CheckFreeSpace(_x) uart_check_free_space(&uart3, _x)
|
||||
#define UART3Transmit(_x) uart_transmit(&uart3, _x)
|
||||
#define UART3SendMessage() {}
|
||||
#define UART3ChAvailable() uart_char_available(&uart3)
|
||||
#define UART3Getch() uart_getch(&uart3)
|
||||
#define UART3TxRunning uart3.tx_running
|
||||
#define UART3SetBaudrate(_b) uart_periph_set_baudrate(&uart3, _b)
|
||||
#define UART3SetBitsStopParity(_b, _s, _p) uart_periph_set_bits_stop_parity(&uart3, _b, _s, _p)
|
||||
|
||||
#endif // USE_UART3
|
||||
|
||||
#if USE_UART4
|
||||
extern struct uart_periph uart4;
|
||||
extern void uart4_init(void);
|
||||
|
||||
#define UART4Init() uart_periph_init(&uart4)
|
||||
#define UART4CheckFreeSpace(_x) uart_check_free_space(&uart4, _x)
|
||||
#define UART4Transmit(_x) uart_transmit(&uart4, _x)
|
||||
#define UART4SendMessage() {}
|
||||
#define UART4ChAvailable() uart_char_available(&uart4)
|
||||
#define UART4Getch() uart_getch(&uart4)
|
||||
#define UART4TxRunning uart4.tx_running
|
||||
#define UART4SetBaudrate(_b) uart_periph_set_baudrate(&uart4, _b)
|
||||
#define UART4SetBitsStopParity(_b, _s, _p) uart_periph_set_bits_stop_parity(&uart4, _b, _s, _p)
|
||||
|
||||
#endif // USE_UART4
|
||||
|
||||
#if USE_UART5
|
||||
extern struct uart_periph uart5;
|
||||
extern void uart5_init(void);
|
||||
|
||||
#define UART5Init() uart_periph_init(&uart5)
|
||||
#define UART5CheckFreeSpace(_x) uart_check_free_space(&uart5, _x)
|
||||
#define UART5Transmit(_x) uart_transmit(&uart5, _x)
|
||||
#define UART5SendMessage() {}
|
||||
#define UART5ChAvailable() uart_char_available(&uart5)
|
||||
#define UART5Getch() uart_getch(&uart5)
|
||||
#define UART5TxRunning uart5.tx_running
|
||||
#define UART5SetBaudrate(_b) uart_periph_set_baudrate(&uart5, _b)
|
||||
#define UART5SetBitsStopParity(_b, _s, _p) uart_periph_set_bits_stop_parity(&uart5, _b, _s, _p)
|
||||
|
||||
#endif // USE_UART5
|
||||
|
||||
#if USE_UART6
|
||||
extern struct uart_periph uart6;
|
||||
extern void uart6_init(void);
|
||||
|
||||
#define UART6Init() uart_periph_init(&uart6)
|
||||
#define UART6CheckFreeSpace(_x) uart_check_free_space(&uart6, _x)
|
||||
#define UART6Transmit(_x) uart_transmit(&uart6, _x)
|
||||
#define UART6SendMessage() {}
|
||||
#define UART6ChAvailable() uart_char_available(&uart6)
|
||||
#define UART6Getch() uart_getch(&uart6)
|
||||
#define UART6TxRunning uart6.tx_running
|
||||
#define UART6SetBaudrate(_b) uart_periph_set_baudrate(&uart6, _b)
|
||||
#define UART6SetBitsStopParity(_b, _s, _p) uart_periph_set_bits_stop_parity(&uart6, _b, _s, _p)
|
||||
|
||||
#endif // USE_UART6
|
||||
|
||||
#endif /* MCU_PERIPH_UART_H */
|
||||
|
||||
@@ -80,11 +80,6 @@ extern struct udp_periph udp0;
|
||||
#endif
|
||||
|
||||
#define UDP0Init() udp_periph_init(&udp0, UDP0_HOST, UDP0_PORT_OUT, UDP0_PORT_IN, UDP0_BROADCAST)
|
||||
#define UDP0CheckFreeSpace(_x) udp_check_free_space(&udp0, _x)
|
||||
#define UDP0Transmit(_x) udp_transmit(&udp0, _x)
|
||||
#define UDP0SendMessage() udp_send_message(&udp0)
|
||||
#define UDP0ChAvailable() udp_char_available(&udp0)
|
||||
#define UDP0Getch() udp_getch(&udp0)
|
||||
#endif // USE_UDP0
|
||||
|
||||
#if USE_UDP1
|
||||
@@ -107,11 +102,6 @@ extern struct udp_periph udp1;
|
||||
#endif
|
||||
|
||||
#define UDP1Init() udp_periph_init(&udp1, UDP1_HOST, UDP1_PORT_OUT, UDP1_PORT_IN, UDP1_BROADCAST)
|
||||
#define UDP1CheckFreeSpace(_x) udp_check_free_space(&udp1, _x)
|
||||
#define UDP1Transmit(_x) udp_transmit(&udp1, _x)
|
||||
#define UDP1SendMessage() udp_send_message(&udp1)
|
||||
#define UDP1ChAvailable() udp_char_available(&udp1)
|
||||
#define UDP1Getch() udp_getch(&udp1)
|
||||
#endif // USE_UDP1
|
||||
|
||||
#if USE_UDP2
|
||||
@@ -134,11 +124,6 @@ extern struct udp_periph udp2;
|
||||
#endif
|
||||
|
||||
#define UDP2Init() udp_periph_init(&udp2, UDP2_HOST, UDP2_PORT_OUT, UDP2_PORT_IN, UDP2_BROADCAST)
|
||||
#define UDP2CheckFreeSpace(_x) udp_check_free_space(&udp2, _x)
|
||||
#define UDP2Transmit(_x) udp_transmit(&udp2, _x)
|
||||
#define UDP2SendMessage() udp_send_message(&udp2)
|
||||
#define UDP2ChAvailable() udp_char_available(&udp2)
|
||||
#define UDP2Getch() udp_getch(&udp2)
|
||||
#endif // USE_UDP2
|
||||
|
||||
#endif /* MCU_PERIPH_UDP_H */
|
||||
|
||||
@@ -49,15 +49,4 @@ void VCOM_allow_linecoding(uint8_t mode);
|
||||
void VCOM_send_message(void);
|
||||
void VCOM_event(void);
|
||||
|
||||
/*
|
||||
* Macros can be used in subsystems that normally work with serial ports
|
||||
* e.g. use UsbS instead of UART1
|
||||
*/
|
||||
#define UsbSInit() VCOM_init()
|
||||
#define UsbSCheckFreeSpace(_x) VCOM_check_free_space(_x)
|
||||
#define UsbSTransmit(_x) VCOM_putchar(_x)
|
||||
#define UsbSSendMessage() VCOM_send_message()
|
||||
#define UsbSGetch() VCOM_getchar()
|
||||
#define UsbSChAvailable() VCOM_check_available()
|
||||
|
||||
#endif /* USB_S_H */
|
||||
|
||||
@@ -75,28 +75,3 @@ restart:
|
||||
t->status = UNINIT;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
static inline void pprz_parse_payload(struct pprz_transport * t) {
|
||||
uint8_t i;
|
||||
for(i = 0; i < t->trans.payload_len; i++)
|
||||
dl_buffer[i] = t->trans.payload[i];
|
||||
dl_msg_available = TRUE;
|
||||
}
|
||||
|
||||
|
||||
#define PprzBuffer(_dev) TransportLink(_dev,ChAvailable())
|
||||
#define ReadPprzBuffer(_dev,_trans) { while (TransportLink(_dev,ChAvailable())&&!(_trans.trans.msg_received)) parse_pprz(&(_trans),TransportLink(_dev,Getch())); }
|
||||
#define PprzCheckAndParse(_dev,_trans) { \
|
||||
if (PprzBuffer(_dev)) { \
|
||||
ReadPprzBuffer(_dev,_trans); \
|
||||
if (_trans.trans.msg_received) { \
|
||||
pprz_parse_payload(&(_trans)); \
|
||||
_trans.trans.msg_received = FALSE; \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -38,10 +38,6 @@ static int32_t seq_in_array(uint8_t *array, uint16_t array_size, uint8_t *sequen
|
||||
static uint8_t start_log_sequence[6] = {0xAA, 0x55, 0xFF, 0x00, 0x55, 0xAA};
|
||||
static uint8_t stop_log_sequence[6] = {0xFF, 0x00, 0x55, 0xAA, 0x10, 0xFF};
|
||||
|
||||
// The logging output connection
|
||||
#define __DMLoggerLink(dev, _x) dev##_x
|
||||
#define _DMLoggerLink(dev, _x) __DMLoggerLink(dev, _x)
|
||||
#define DMLoggerLink(_x) _DMLoggerLink(DM_LOG_UART, _x)
|
||||
|
||||
// Logging struct
|
||||
struct LogStruct {
|
||||
@@ -149,7 +145,7 @@ void direct_memory_logger_periodic(void)
|
||||
dml.status = DML_READING;
|
||||
case DML_READING:
|
||||
|
||||
if (DMLoggerLink(TxRunning) || dml.sst.status != SST25VFXXXX_IDLE) {
|
||||
if (DM_LOG_UART.tx_running || dml.sst.status != SST25VFXXXX_IDLE) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -163,7 +159,7 @@ void direct_memory_logger_periodic(void)
|
||||
}
|
||||
|
||||
for (i = 5; i < end_idx; i++) {
|
||||
DMLoggerLink(Transmit(dml.buffer[i]));
|
||||
uart_transmit(&DM_LOG_UART, dml.buffer[i]);
|
||||
}
|
||||
|
||||
// Read next bytes
|
||||
|
||||
@@ -55,9 +55,4 @@ struct chibios_sdlog {
|
||||
|
||||
extern struct chibios_sdlog chibios_sdlog;
|
||||
|
||||
/** Paparazzi datalink API */
|
||||
#define SDLOGCheckFreeSpace(_x) (true)
|
||||
#define SDLOGTransmit(_x) sdLogWriteByte(&pprzLogFile, _x)
|
||||
#define SDLOGSendMessage() {}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -125,14 +125,6 @@ extern void superbitrf_event(void);
|
||||
extern void superbitrf_set_mfg_id(uint32_t id);
|
||||
extern void superbitrf_set_protocol(uint8_t protocol);
|
||||
|
||||
/* The datalink defines */
|
||||
#define SuperbitRFInit() { }//superbitrf_init(); }
|
||||
#define SuperbitRFCheckFreeSpace(_x) (((superbitrf.tx_insert_idx+1) %SUPERBITRF_TX_BUFFER_SIZE) != superbitrf.tx_extract_idx)
|
||||
#define SuperbitRFTransmit(_x) { \
|
||||
superbitrf.tx_buffer[superbitrf.tx_insert_idx] = _x; \
|
||||
superbitrf.tx_insert_idx = (superbitrf.tx_insert_idx+1) %SUPERBITRF_TX_BUFFER_SIZE; \
|
||||
}
|
||||
#define SuperbitRFSendMessage() { }
|
||||
#define SuperbitRFCheckAndParse() { }
|
||||
|
||||
#endif /* DATALINK_SUPERBITRF_H */
|
||||
|
||||
@@ -70,17 +70,6 @@ void w5100_send(void);
|
||||
uint16_t w5100_rx_size(uint8_t _s);
|
||||
bool_t w5100_ch_available(void);
|
||||
|
||||
// Defines that are done in mcu_periph on behalf of uart.
|
||||
// We need to do these here...
|
||||
#define W5100Init() w5100_init()
|
||||
#define W5100CheckFreeSpace(_x) (TRUE) // w5100_check_free_space(_x)
|
||||
#define W5100Transmit(_x) w5100_transmit(_x)
|
||||
#define W5100SendMessage() w5100_send()
|
||||
#define W5100ChAvailable() w5100_ch_available()
|
||||
#define W5100Getch() w5100_getch()
|
||||
#define W5100TxRunning chip0.tx_running
|
||||
#define W5100SetBaudrate(_b) w5100_set_baudrate(_b)
|
||||
|
||||
|
||||
// W5100 is using pprz_transport
|
||||
// FIXME it should not appear here, this will be fixed with the rx improvements some day...
|
||||
|
||||
Reference in New Issue
Block a user