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>
|
#include <stdbool.h>
|
||||||
|
|
||||||
//#undef PIOS_INCLUDE_USB
|
|
||||||
|
|
||||||
// ****************
|
// ****************
|
||||||
// Private constants
|
// Private constants
|
||||||
|
|
||||||
@ -635,7 +633,7 @@ static int32_t transmitData(uint8_t *buf, int32_t length)
|
|||||||
*/
|
*/
|
||||||
static int32_t transmitPacket(PHPacketHandle p)
|
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 */
|
#endif /* PIOS_INCLUDE_USB */
|
||||||
|
|
||||||
// Send the received data to the com port
|
// 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
|
// Error on transmit
|
||||||
data->comTxErrors++;
|
data->comTxErrors++;
|
||||||
}
|
}
|
||||||
|
@ -437,6 +437,14 @@ static const struct pios_usb_cfg pios_usb_main_cfg = {
|
|||||||
.NVIC_IRQChannelCmd = ENABLE,
|
.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"
|
#include "pios_usb_board_data_priv.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user