1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-30 08:24:11 +01:00

Reverted USB configuration and switched all non-blocking COM calls to blocking, which appears to help prevent lockups now that all sends are in a different thread.

This commit is contained in:
Brian Webb 2012-05-06 15:07:07 -07:00
parent d3c6a8c0da
commit 352471857f
2 changed files with 18 additions and 12 deletions

View File

@ -43,8 +43,6 @@
#include <stdbool.h>
//#undef PIOS_INCLUDE_USB
// ****************
// Private constants
@ -635,7 +633,7 @@ static int32_t transmitData(uint8_t *buf, int32_t length)
*/
static int32_t transmitPacket(PHPacketHandle p)
{
return PIOS_COM_SendBufferNonBlocking(data->radio_port, (uint8_t*)p, PH_PACKET_SIZE(p));
return PIOS_COM_SendBuffer(data->radio_port, (uint8_t*)p, PH_PACKET_SIZE(p));
}
/**
@ -653,7 +651,7 @@ static void receiveData(uint8_t *buf, uint8_t len)
#endif /* PIOS_INCLUDE_USB */
// Send the received data to the com port
if (PIOS_COM_SendBufferNonBlocking(outputPort, buf, len) != len)
if (PIOS_COM_SendBuffer(outputPort, buf, len) != len)
// Error on transmit
data->comTxErrors++;
}

View File

@ -429,14 +429,22 @@ static const struct pios_tim_clock_cfg tim_4_cfg = {
#include "pios_usb_priv.h"
static const struct pios_usb_cfg pios_usb_main_cfg = {
.irq = {
.init = {
.NVIC_IRQChannel = USB_LP_CAN1_RX0_IRQn,
.NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_LOW,
.NVIC_IRQChannelSubPriority = 0,
.NVIC_IRQChannelCmd = ENABLE,
},
},
.irq = {
.init = {
.NVIC_IRQChannel = USB_LP_CAN1_RX0_IRQn,
.NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_LOW,
.NVIC_IRQChannelSubPriority = 0,
.NVIC_IRQChannelCmd = ENABLE,
},
},
.vsense = {
.gpio = GPIOA,
.init = {
.GPIO_Pin = GPIO_Pin_8,
.GPIO_Speed = GPIO_Speed_10MHz,
.GPIO_Mode = GPIO_Mode_AF_OD,
},
}
};
#include "pios_usb_board_data_priv.h"