Fixed bug #963.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12168 110e8d01-0319-4d1e-a829-52ad28d1bb01
This commit is contained in:
parent
2f43a43dca
commit
286e534904
|
@ -358,15 +358,11 @@ msg_t ibqGetTimeout(input_buffers_queue_t *ibqp, sysinterval_t timeout) {
|
||||||
size_t ibqReadTimeout(input_buffers_queue_t *ibqp, uint8_t *bp,
|
size_t ibqReadTimeout(input_buffers_queue_t *ibqp, uint8_t *bp,
|
||||||
size_t n, sysinterval_t timeout) {
|
size_t n, sysinterval_t timeout) {
|
||||||
size_t r = 0;
|
size_t r = 0;
|
||||||
systime_t deadline;
|
|
||||||
|
|
||||||
osalDbgCheck(n > 0U);
|
osalDbgCheck(n > 0U);
|
||||||
|
|
||||||
osalSysLock();
|
osalSysLock();
|
||||||
|
|
||||||
/* Time window for the whole operation.*/
|
|
||||||
deadline = osalTimeAddX(osalOsGetSystemTimeX(), timeout);
|
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
size_t size;
|
size_t size;
|
||||||
|
|
||||||
|
@ -374,24 +370,8 @@ size_t ibqReadTimeout(input_buffers_queue_t *ibqp, uint8_t *bp,
|
||||||
if (ibqp->ptr == NULL) {
|
if (ibqp->ptr == NULL) {
|
||||||
msg_t msg;
|
msg_t msg;
|
||||||
|
|
||||||
/* TIME_INFINITE and TIME_IMMEDIATE are handled differently, no
|
/* Getting a data buffer using the specified timeout.*/
|
||||||
deadline.*/
|
|
||||||
if ((timeout == TIME_INFINITE) || (timeout == TIME_IMMEDIATE)) {
|
|
||||||
msg = ibqGetFullBufferTimeoutS(ibqp, timeout);
|
msg = ibqGetFullBufferTimeoutS(ibqp, timeout);
|
||||||
}
|
|
||||||
else {
|
|
||||||
sysinterval_t next_timeout = osalTimeDiffX(osalOsGetSystemTimeX(),
|
|
||||||
deadline);
|
|
||||||
|
|
||||||
/* Handling the case where the system time went past the deadline,
|
|
||||||
in this case next becomes a very high number because the system
|
|
||||||
time is an unsigned type.*/
|
|
||||||
if (next_timeout > timeout) {
|
|
||||||
osalSysUnlock();
|
|
||||||
return r;
|
|
||||||
}
|
|
||||||
msg = ibqGetFullBufferTimeoutS(ibqp, next_timeout);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Anything except MSG_OK interrupts the operation.*/
|
/* Anything except MSG_OK interrupts the operation.*/
|
||||||
if (msg != MSG_OK) {
|
if (msg != MSG_OK) {
|
||||||
|
@ -741,15 +721,11 @@ msg_t obqPutTimeout(output_buffers_queue_t *obqp, uint8_t b,
|
||||||
size_t obqWriteTimeout(output_buffers_queue_t *obqp, const uint8_t *bp,
|
size_t obqWriteTimeout(output_buffers_queue_t *obqp, const uint8_t *bp,
|
||||||
size_t n, sysinterval_t timeout) {
|
size_t n, sysinterval_t timeout) {
|
||||||
size_t w = 0;
|
size_t w = 0;
|
||||||
systime_t deadline;
|
|
||||||
|
|
||||||
osalDbgCheck(n > 0U);
|
osalDbgCheck(n > 0U);
|
||||||
|
|
||||||
osalSysLock();
|
osalSysLock();
|
||||||
|
|
||||||
/* Time window for the whole operation.*/
|
|
||||||
deadline = osalTimeAddX(osalOsGetSystemTimeX(), timeout);
|
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
size_t size;
|
size_t size;
|
||||||
|
|
||||||
|
@ -757,24 +733,8 @@ size_t obqWriteTimeout(output_buffers_queue_t *obqp, const uint8_t *bp,
|
||||||
if (obqp->ptr == NULL) {
|
if (obqp->ptr == NULL) {
|
||||||
msg_t msg;
|
msg_t msg;
|
||||||
|
|
||||||
/* TIME_INFINITE and TIME_IMMEDIATE are handled differently, no
|
/* Getting an empty buffer using the specified timeout.*/
|
||||||
deadline.*/
|
|
||||||
if ((timeout == TIME_INFINITE) || (timeout == TIME_IMMEDIATE)) {
|
|
||||||
msg = obqGetEmptyBufferTimeoutS(obqp, timeout);
|
msg = obqGetEmptyBufferTimeoutS(obqp, timeout);
|
||||||
}
|
|
||||||
else {
|
|
||||||
sysinterval_t next_timeout = osalTimeDiffX(osalOsGetSystemTimeX(),
|
|
||||||
deadline);
|
|
||||||
|
|
||||||
/* Handling the case where the system time went past the deadline,
|
|
||||||
in this case next becomes a very high number because the system
|
|
||||||
time is an unsigned type.*/
|
|
||||||
if (next_timeout > timeout) {
|
|
||||||
osalSysUnlock();
|
|
||||||
return w;
|
|
||||||
}
|
|
||||||
msg = obqGetEmptyBufferTimeoutS(obqp, next_timeout);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Anything except MSG_OK interrupts the operation.*/
|
/* Anything except MSG_OK interrupts the operation.*/
|
||||||
if (msg != MSG_OK) {
|
if (msg != MSG_OK) {
|
||||||
|
|
|
@ -141,6 +141,8 @@
|
||||||
- EX: Updated LIS302DL to 1.1.0 (backported to 18.2.1).
|
- EX: Updated LIS302DL to 1.1.0 (backported to 18.2.1).
|
||||||
- EX: Updated LPS25H to 1.1.0 (backported to 18.2.1).
|
- EX: Updated LPS25H to 1.1.0 (backported to 18.2.1).
|
||||||
- EX: Updated LSM303DLHC to 1.1.0 (backported to 18.2.1).
|
- EX: Updated LSM303DLHC to 1.1.0 (backported to 18.2.1).
|
||||||
|
- HAL: Fixed invalid timeout calculation in hal_buffers (bug #963)(backported
|
||||||
|
to 18.2.2 and 17.6.5).
|
||||||
- RT: Fixed invalid parameter in CH_CFG_SYSTEM_INIT_HOOK hook macro
|
- RT: Fixed invalid parameter in CH_CFG_SYSTEM_INIT_HOOK hook macro
|
||||||
(bug #962)(backported to 18.2.2).
|
(bug #962)(backported to 18.2.2).
|
||||||
- OTH: Fixed demos failing to compile (bug #961)(backported to 18.2.2).
|
- OTH: Fixed demos failing to compile (bug #961)(backported to 18.2.2).
|
||||||
|
@ -160,7 +162,7 @@
|
||||||
18.2.2 and 17.6.5).
|
18.2.2 and 17.6.5).
|
||||||
- HAL: Fixed wrong registry entries for STM32F030x4 (bug #952)(backported
|
- HAL: Fixed wrong registry entries for STM32F030x4 (bug #952)(backported
|
||||||
to 18.2.2).
|
to 18.2.2).
|
||||||
- HAL: Fixed Invalid divider settings in Serial and UART STM32 drivers
|
- HAL: Fixed invalid divider settings in Serial and UART STM32 drivers
|
||||||
when USART_CR1_OVER8 is specified (bug #951)(backported to 18.2.2
|
when USART_CR1_OVER8 is specified (bug #951)(backported to 18.2.2
|
||||||
and 17.6.5).
|
and 17.6.5).
|
||||||
- NIL: Fixed missing extern declaration in IAR Cortex-M port (bug #950)
|
- NIL: Fixed missing extern declaration in IAR Cortex-M port (bug #950)
|
||||||
|
|
|
@ -34,8 +34,8 @@
|
||||||
<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
|
<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
|
||||||
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_REGISTER_GROUPS" value=""/>
|
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_REGISTER_GROUPS" value=""/>
|
||||||
<stringAttribute key="org.eclipse.cdt.launch.FORMAT" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?><contentList><content id="r2-(format)" val="4"/><content id="r3-(format)" val="4"/><content id="r6-(format)" val="4"/><content id="xPSR-(format)" val="4"/></contentList>"/>
|
<stringAttribute key="org.eclipse.cdt.launch.FORMAT" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?><contentList><content id="r2-(format)" val="4"/><content id="r3-(format)" val="4"/><content id="r6-(format)" val="4"/><content id="xPSR-(format)" val="4"/></contentList>"/>
|
||||||
<stringAttribute key="org.eclipse.cdt.launch.GLOBAL_VARIABLES" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <globalVariableList/> "/>
|
<stringAttribute key="org.eclipse.cdt.launch.GLOBAL_VARIABLES" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <globalVariableList/> "/>
|
||||||
<stringAttribute key="org.eclipse.cdt.launch.MEMORY_BLOCKS" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <memoryBlockExpressionList> <memoryBlockExpressionItem> <expression text="0x58024400"/> </memoryBlockExpressionItem> </memoryBlockExpressionList> "/>
|
<stringAttribute key="org.eclipse.cdt.launch.MEMORY_BLOCKS" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <memoryBlockExpressionList> <memoryBlockExpressionItem> <expression text="0x58024400"/> </memoryBlockExpressionItem> </memoryBlockExpressionList> "/>
|
||||||
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="${selected_resource_loc}"/>
|
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="${selected_resource_loc}"/>
|
||||||
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="STM32-USB_CDC"/>
|
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="STM32-USB_CDC"/>
|
||||||
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="false"/>
|
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="false"/>
|
||||||
|
|
Loading…
Reference in New Issue