mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-11-30 08:24:11 +01:00
Merge remote-tracking branch 'raid/Brian-PipXtreme-V2' into Brian-PipXtreme-V2
This commit is contained in:
commit
f90f25e133
@ -48,23 +48,17 @@
|
||||
// Private constants
|
||||
|
||||
#define TEMP_BUFFER_SIZE 25
|
||||
|
||||
#define STACK_SIZE_BYTES 300
|
||||
#define TASK_PRIORITY (tskIDLE_PRIORITY + 1)
|
||||
|
||||
#define BRIDGE_BUF_LEN 512
|
||||
|
||||
#define MAX_RETRIES 2
|
||||
#define REQ_TIMEOUT_MS 10
|
||||
|
||||
#define STATS_UPDATE_PERIOD_MS 500
|
||||
#define RADIOSTATS_UPDATE_PERIOD_MS 500
|
||||
|
||||
#define MAX_LOST_CONTACT_TIME 10
|
||||
|
||||
#define PACKET_QUEUE_SIZE 5
|
||||
|
||||
#define EV_PACKET_RECEIVED 0x10
|
||||
#define MAX_PORT_DELAY 200
|
||||
|
||||
// ****************
|
||||
// Private types
|
||||
@ -278,7 +272,7 @@ static void comUAVTalkTask(void *parameters)
|
||||
|
||||
// Read the next byte
|
||||
uint8_t rx_byte;
|
||||
if(!BufferedRead(f, &rx_byte, 100))
|
||||
if(!BufferedRead(f, &rx_byte, MAX_PORT_DELAY))
|
||||
continue;
|
||||
|
||||
// Get a TX packet from the packet handler if required.
|
||||
@ -352,7 +346,7 @@ static void radioReceiveTask(void *parameters)
|
||||
p = PHGetRXPacket(pios_packet_handler);
|
||||
|
||||
// Receive data from the radio port
|
||||
rx_bytes = PIOS_COM_ReceiveBuffer(data->radio_port, (uint8_t*)p, PIOS_PH_MAX_PACKET, 200);
|
||||
rx_bytes = PIOS_COM_ReceiveBuffer(data->radio_port, (uint8_t*)p, PIOS_PH_MAX_PACKET, MAX_PORT_DELAY);
|
||||
|
||||
// Verify that the packet is valid and pass it on.
|
||||
if(PHVerifyPacket(pios_packet_handler, p, rx_bytes) > 0) {
|
||||
@ -379,7 +373,7 @@ static void sendPacketTask(void *parameters)
|
||||
PIOS_WDG_UpdateFlag(PIOS_WDG_SENDPACKET);
|
||||
#endif /* PIOS_INCLUDE_WDG */
|
||||
// Wait for a packet on the queue.
|
||||
if (xQueueReceive(data->sendPacketQueue, &p, portMAX_DELAY) == pdTRUE) {
|
||||
if (xQueueReceive(data->sendPacketQueue, &p, MAX_PORT_DELAY) == pdTRUE) {
|
||||
// Send the packet.
|
||||
PHTransmitPacket(pios_packet_handler, p);
|
||||
}
|
||||
@ -400,7 +394,7 @@ static void sendDataTask(void *parameters)
|
||||
PIOS_WDG_UpdateFlag(PIOS_WDG_SENDDATA);
|
||||
#endif /* PIOS_INCLUDE_WDG */
|
||||
// Wait for a packet on the queue.
|
||||
if (xQueueReceive(data->objEventQueue, &ev, portMAX_DELAY) == pdTRUE) {
|
||||
if (xQueueReceive(data->objEventQueue, &ev, MAX_PORT_DELAY) == pdTRUE) {
|
||||
if (ev.event == EV_UPDATED)
|
||||
{
|
||||
// Send update (with retries)
|
||||
|
@ -285,7 +285,7 @@ extern uint32_t pios_rfm22b_id;
|
||||
uint32_t pios_packet_handler;
|
||||
#define PIOS_INCLUDE_PACKET_HANDLER
|
||||
#define PIOS_PH_MAX_PACKET 255
|
||||
#define PIOS_PH_TX_WIN_SIZE 3
|
||||
#define PIOS_PH_WIN_SIZE 3
|
||||
#define PIOS_PH_MAX_CONNECTIONS 1
|
||||
|
||||
//-------------------------
|
||||
|
@ -39,9 +39,6 @@ struct pios_rfm22b_cfg {
|
||||
uint8_t RFXtalCap;
|
||||
uint32_t maxRFBandwidth;
|
||||
uint8_t maxTxPower;
|
||||
uint32_t sendTimeout;
|
||||
uint8_t minPacketSize;
|
||||
uint8_t maxConnections;
|
||||
};
|
||||
|
||||
/* Public Functions */
|
||||
|
@ -455,7 +455,7 @@ static const struct pios_usb_cfg pios_usb_main_cfg = {
|
||||
#include <pios_usb_hid_priv.h>
|
||||
|
||||
const struct pios_usb_hid_cfg pios_usb_hid_cfg = {
|
||||
.data_if = 0,
|
||||
.data_if = 2,
|
||||
.data_rx_ep = 1,
|
||||
.data_tx_ep = 1,
|
||||
};
|
||||
@ -465,10 +465,10 @@ const struct pios_usb_hid_cfg pios_usb_hid_cfg = {
|
||||
#include <pios_usb_cdc_priv.h>
|
||||
|
||||
const struct pios_usb_cdc_cfg pios_usb_cdc_cfg = {
|
||||
.ctrl_if = 1,
|
||||
.ctrl_if = 0,
|
||||
.ctrl_tx_ep = 2,
|
||||
|
||||
.data_if = 2,
|
||||
.data_if = 1,
|
||||
.data_rx_ep = 3,
|
||||
.data_tx_ep = 3,
|
||||
};
|
||||
@ -494,9 +494,6 @@ const struct pios_rfm22b_cfg pios_rfm22b_cfg = {
|
||||
.maxRFBandwidth = 128000,
|
||||
//.maxTxPower = RFM22_tx_pwr_txpow_0, // +1dBm ... 1.25mW
|
||||
.maxTxPower = RFM22_tx_pwr_txpow_7, // +20dBm .. 100mW
|
||||
.sendTimeout = 25, /* ms */
|
||||
.minPacketSize = 100,
|
||||
.maxConnections = 1,
|
||||
};
|
||||
|
||||
#endif /* PIOS_INCLUDE_RFM22B */
|
||||
@ -506,7 +503,7 @@ const struct pios_rfm22b_cfg pios_rfm22b_cfg = {
|
||||
|
||||
// Initialize the packet handler
|
||||
PacketHandlerConfig pios_ph_cfg = {
|
||||
.winSize = PIOS_PH_TX_WIN_SIZE,
|
||||
.winSize = PIOS_PH_WIN_SIZE,
|
||||
.maxConnections = PIOS_PH_MAX_CONNECTIONS,
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user