mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-18 03:52:11 +01:00
Fixed watchdog timeouts.
This commit is contained in:
parent
217aad8c37
commit
290acf0398
@ -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 */
|
||||
|
@ -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…
x
Reference in New Issue
Block a user