mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-06 07:53:43 +08:00
[sbus] code cleaning and comments
This commit is contained in:
committed by
Felix Ruess
parent
8fa5406d1a
commit
f9be3ce38d
@@ -41,11 +41,8 @@
|
||||
|
||||
void uart_periph_set_baudrate(struct uart_periph* p, uint32_t baud) {
|
||||
|
||||
/* Configure USART */
|
||||
/* Configure USART baudrate */
|
||||
usart_set_baudrate((uint32_t)p->reg_addr, baud);
|
||||
//usart_set_databits((uint32_t)p->reg_addr, 8);
|
||||
//usart_set_stopbits((uint32_t)p->reg_addr, USART_STOPBITS_1);
|
||||
//usart_set_parity((uint32_t)p->reg_addr, USART_PARITY_NONE);
|
||||
|
||||
/* Disable Idle Line interrupt */
|
||||
USART_CR1((uint32_t)p->reg_addr) &= ~USART_CR1_IDLEIE;
|
||||
@@ -62,6 +59,7 @@ void uart_periph_set_baudrate(struct uart_periph* p, uint32_t baud) {
|
||||
}
|
||||
|
||||
void uart_periph_set_bits_stop_parity(struct uart_periph* p, uint8_t bits, uint8_t stop, uint8_t parity) {
|
||||
/* Configure USART parity and data bits */
|
||||
if (parity == UPARITY_EVEN) {
|
||||
usart_set_parity((uint32_t)p->reg_addr, USART_PARITY_EVEN);
|
||||
if (bits == UBITS_7)
|
||||
@@ -80,6 +78,7 @@ void uart_periph_set_bits_stop_parity(struct uart_periph* p, uint8_t bits, uint8
|
||||
usart_set_parity((uint32_t)p->reg_addr, USART_PARITY_NONE);
|
||||
usart_set_databits((uint32_t)p->reg_addr, 8); // is 7bits without parity possible ?
|
||||
}
|
||||
/* Configure USART stop bits */
|
||||
if (stop == USTOP_2)
|
||||
usart_set_stopbits((uint32_t)p->reg_addr, USART_STOPBITS_2);
|
||||
else // 1 stop bit by default
|
||||
|
||||
@@ -29,13 +29,6 @@
|
||||
|
||||
#include "std.h"
|
||||
|
||||
///**
|
||||
// * Architecture dependant code
|
||||
// */
|
||||
//#include "subsystems/radio_control/ppm_arch.h"
|
||||
///* must be implemented by arch dependant code */
|
||||
//extern void ppm_arch_init(void);
|
||||
|
||||
/**
|
||||
* Dummy macro to use radio.h file
|
||||
*/
|
||||
@@ -50,7 +43,13 @@
|
||||
#include "generated/radio.h"
|
||||
|
||||
/**
|
||||
* Define number of channels
|
||||
* Define number of channels.
|
||||
*
|
||||
* SBUS frame always have 16 channels
|
||||
* but only the X first one will be available
|
||||
* depending of the RC transmitter.
|
||||
* The radio XML file is used to assign the
|
||||
* input values to RC channels.
|
||||
*/
|
||||
#define SBUS_BUF_LENGTH 24
|
||||
#define SBUS_NB_CHANNEL 16
|
||||
|
||||
Reference in New Issue
Block a user