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:
parent
d3c6a8c0da
commit
352471857f
@ -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++;
|
||||
}
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user