mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-17 02:52:12 +01:00
Updated PipX branch to use CDC device with a VCP (not working yet).
This commit is contained in:
parent
e2cb750dc6
commit
992aa3bec6
@ -150,6 +150,7 @@ extern uint32_t pios_i2c_flexi_adapter_id;
|
||||
#define PIOS_COM_MAX_DEVS 4
|
||||
|
||||
extern uint32_t pios_com_telem_usb_id;
|
||||
extern uint32_t pios_com_vcp_usb_id;
|
||||
extern uint32_t pios_com_usart1_id;
|
||||
extern uint32_t pios_com_usart2_id;
|
||||
extern uint32_t pios_com_usart3_id;
|
||||
@ -157,6 +158,7 @@ extern uint32_t pios_com_usart3_id;
|
||||
#define PIOS_COM_DEBUG (pios_com_usart2_id)
|
||||
#define PIOS_COM_FLEXI (pios_com_usart3_id)
|
||||
#define PIOS_COM_TELEM_USB (pios_com_telem_usb_id)
|
||||
#define PIOS_COM_VCP_USB (pios_com_vcp_usb_id)
|
||||
|
||||
//------------------------
|
||||
// PIOS_RCVR
|
||||
|
@ -36,9 +36,7 @@
|
||||
/* Enable/Disable PiOS Modules */
|
||||
//#define PIOS_INCLUDE_ADC
|
||||
#define PIOS_INCLUDE_DELAY
|
||||
#ifdef MOVE_CONTROLLER
|
||||
#define PIOS_INCLUDE_I2C
|
||||
#endif
|
||||
//#define PIOS_INCLUDE_I2C
|
||||
#define PIOS_INCLUDE_IRQ
|
||||
#define PIOS_INCLUDE_LED
|
||||
#define PIOS_INCLUDE_IAP
|
||||
@ -61,7 +59,7 @@
|
||||
#define PIOS_INCLUDE_USART
|
||||
#define PIOS_INCLUDE_USB
|
||||
#define PIOS_INCLUDE_USB_HID
|
||||
//#define PIOS_INCLUDE_USB_CDC
|
||||
#define PIOS_INCLUDE_USB_CDC
|
||||
#define PIOS_INCLUDE_COM
|
||||
#define PIOS_INCLUDE_SETTINGS
|
||||
#define PIOS_INCLUDE_FREERTOS
|
||||
@ -72,11 +70,6 @@
|
||||
#define PIOS_INCLUDE_BL_HELPER
|
||||
|
||||
#define PIOS_INCLUDE_FLASH
|
||||
#ifdef MOVE_CONTROLLER
|
||||
#define PIOS_INCLUDE_MARG_MAHONY
|
||||
#define PIOS_INCLUDE_AK8974
|
||||
#define PIOS_INCLUDE_KXSC4
|
||||
#endif
|
||||
|
||||
#define PIOS_UAVTALK_DEBUG
|
||||
|
||||
|
@ -397,11 +397,12 @@ static const struct pios_usart_cfg pios_usart_telem_flexi_cfg = {
|
||||
#define PIOS_COM_TELEM_RF_RX_BUF_LEN 192
|
||||
#define PIOS_COM_TELEM_RF_TX_BUF_LEN 192
|
||||
|
||||
#define PIOS_COM_GPS_RX_BUF_LEN 96
|
||||
|
||||
#define PIOS_COM_TELEM_USB_RX_BUF_LEN 192
|
||||
#define PIOS_COM_TELEM_USB_TX_BUF_LEN 192
|
||||
|
||||
#define PIOS_COM_VCP_USB_RX_BUF_LEN 192
|
||||
#define PIOS_COM_VCP_USB_TX_BUF_LEN 192
|
||||
|
||||
#if defined(PIOS_INCLUDE_RTC)
|
||||
/*
|
||||
* Realtime Clock (RTC)
|
||||
@ -607,6 +608,7 @@ const struct pios_ppm_cfg pios_ppm_cfg = {
|
||||
uint32_t pios_rcvr_group_map[MANUALCONTROLSETTINGS_CHANNELGROUPS_NONE];
|
||||
|
||||
uint32_t pios_com_telem_usb_id;
|
||||
uint32_t pios_com_vcp_usb_id;
|
||||
uint32_t pios_com_usart1_id;
|
||||
uint32_t pios_com_usart2_id;
|
||||
uint32_t pios_com_usart3_id;
|
||||
@ -735,38 +737,18 @@ void PIOS_Board_Init(void) {
|
||||
if (PIOS_USB_CDC_Init(&pios_usb_cdc_id, &pios_usb_cdc_cfg, pios_usb_id)) {
|
||||
PIOS_Assert(0);
|
||||
}
|
||||
uint8_t * rx_buffer = (uint8_t *) pvPortMalloc(PIOS_COM_TELEM_USB_RX_BUF_LEN);
|
||||
uint8_t * tx_buffer = (uint8_t *) pvPortMalloc(PIOS_COM_TELEM_USB_TX_BUF_LEN);
|
||||
uint8_t * rx_buffer = (uint8_t *) pvPortMalloc(PIOS_COM_VCP_USB_RX_BUF_LEN);
|
||||
uint8_t * tx_buffer = (uint8_t *) pvPortMalloc(PIOS_COM_VCP_USB_TX_BUF_LEN);
|
||||
PIOS_Assert(rx_buffer);
|
||||
PIOS_Assert(tx_buffer);
|
||||
if (PIOS_COM_Init(&pios_com_telem_usb_id, &pios_usb_cdc_com_driver, pios_usb_cdc_id,
|
||||
rx_buffer, PIOS_COM_TELEM_USB_RX_BUF_LEN,
|
||||
tx_buffer, PIOS_COM_TELEM_USB_TX_BUF_LEN)) {
|
||||
if (PIOS_COM_Init(&pios_com_vcp_usb_id, &pios_usb_cdc_com_driver, pios_usb_cdc_id,
|
||||
rx_buffer, PIOS_COM_VCP_USB_RX_BUF_LEN,
|
||||
tx_buffer, PIOS_COM_VCP_USB_TX_BUF_LEN)) {
|
||||
PIOS_Assert(0);
|
||||
}
|
||||
}
|
||||
#endif /* PIOS_INCLUDE_COM */
|
||||
|
||||
#ifdef COMBRIDGE
|
||||
#if defined(PIOS_INCLUDE_COM)
|
||||
{
|
||||
uint32_t pios_usb_cdc_id;
|
||||
if (PIOS_USB_CDC_Init(&pios_usb_cdc_id, &pios_usb_cdc_cfg, pios_usb_id)) {
|
||||
PIOS_Assert(0);
|
||||
}
|
||||
uint8_t * rx_buffer = (uint8_t *) pvPortMalloc(PIOS_COM_BRIDGE_RX_BUF_LEN);
|
||||
uint8_t * tx_buffer = (uint8_t *) pvPortMalloc(PIOS_COM_BRIDGE_TX_BUF_LEN);
|
||||
PIOS_Assert(rx_buffer);
|
||||
PIOS_Assert(tx_buffer);
|
||||
if (PIOS_COM_Init(&pios_com_vcp_id, &pios_usb_cdc_com_driver, pios_usb_cdc_id,
|
||||
rx_buffer, PIOS_COM_BRIDGE_RX_BUF_LEN,
|
||||
tx_buffer, PIOS_COM_BRIDGE_TX_BUF_LEN)) {
|
||||
PIOS_Assert(0);
|
||||
}
|
||||
}
|
||||
#endif /* PIOS_INCLUDE_COM */
|
||||
#endif
|
||||
|
||||
#endif /* PIOS_INCLUDE_USB_CDC */
|
||||
|
||||
#if defined(PIOS_INCLUDE_USB_HID)
|
||||
|
Loading…
x
Reference in New Issue
Block a user