From a47f5705d3f6abf4abaffa949f7bb50132507d94 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sun, 15 Oct 2017 06:51:20 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/rt5_dev_point1@10822 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/src/hal_buffers.c | 24 ++++++++++++------------ os/hal/src/hal_can.c | 4 ++-- os/hal/src/hal_i2c.c | 4 ++-- os/hal/src/hal_mac.c | 8 ++++---- os/hal/src/hal_pal.c | 7 +++++-- os/hal/src/hal_queues.c | 12 ++++++------ os/hal/src/hal_serial.c | 10 ++++++---- os/hal/src/hal_serial_usb.c | 10 ++++++---- os/hal/src/hal_uart.c | 6 +++--- 9 files changed, 46 insertions(+), 39 deletions(-) (limited to 'os/hal/src') diff --git a/os/hal/src/hal_buffers.c b/os/hal/src/hal_buffers.c index 871fd0a42..0f1e35440 100644 --- a/os/hal/src/hal_buffers.c +++ b/os/hal/src/hal_buffers.c @@ -188,7 +188,7 @@ void ibqPostFullBufferI(input_buffers_queue_t *ibqp, size_t size) { * @api */ msg_t ibqGetFullBufferTimeout(input_buffers_queue_t *ibqp, - systime_t timeout) { + sysinterval_t timeout) { msg_t msg; osalSysLock(); @@ -220,7 +220,7 @@ msg_t ibqGetFullBufferTimeout(input_buffers_queue_t *ibqp, * @sclass */ msg_t ibqGetFullBufferTimeoutS(input_buffers_queue_t *ibqp, - systime_t timeout) { + sysinterval_t timeout) { osalDbgCheckClassS(); @@ -306,7 +306,7 @@ void ibqReleaseEmptyBuffer(input_buffers_queue_t *ibqp) { * * @api */ -msg_t ibqGetTimeout(input_buffers_queue_t *ibqp, systime_t timeout) { +msg_t ibqGetTimeout(input_buffers_queue_t *ibqp, sysinterval_t timeout) { msg_t msg; osalSysLock(); @@ -356,9 +356,9 @@ msg_t ibqGetTimeout(input_buffers_queue_t *ibqp, systime_t timeout) { * @api */ size_t ibqReadTimeout(input_buffers_queue_t *ibqp, uint8_t *bp, - size_t n, systime_t timeout) { + size_t n, sysinterval_t timeout) { size_t r = 0; - systime_t deadline; + sysinterval_t deadline; osalDbgCheck(n > 0U); @@ -380,7 +380,7 @@ size_t ibqReadTimeout(input_buffers_queue_t *ibqp, uint8_t *bp, msg = ibqGetFullBufferTimeoutS(ibqp, timeout); } else { - systime_t next_timeout = deadline - osalOsGetSystemTimeX(); + sysinterval_t next_timeout = deadline - osalOsGetSystemTimeX(); /* Handling the case where the system time went past the deadline, in this case next becomes a very high number because the system @@ -562,7 +562,7 @@ void obqReleaseEmptyBufferI(output_buffers_queue_t *obqp) { * @api */ msg_t obqGetEmptyBufferTimeout(output_buffers_queue_t *obqp, - systime_t timeout) { + sysinterval_t timeout) { msg_t msg; osalSysLock(); @@ -594,7 +594,7 @@ msg_t obqGetEmptyBufferTimeout(output_buffers_queue_t *obqp, * @sclass */ msg_t obqGetEmptyBufferTimeoutS(output_buffers_queue_t *obqp, - systime_t timeout) { + sysinterval_t timeout) { osalDbgCheckClassS(); @@ -688,7 +688,7 @@ void obqPostFullBufferS(output_buffers_queue_t *obqp, size_t size) { * @api */ msg_t obqPutTimeout(output_buffers_queue_t *obqp, uint8_t b, - systime_t timeout) { + sysinterval_t timeout) { msg_t msg; osalSysLock(); @@ -738,9 +738,9 @@ msg_t obqPutTimeout(output_buffers_queue_t *obqp, uint8_t b, * @api */ size_t obqWriteTimeout(output_buffers_queue_t *obqp, const uint8_t *bp, - size_t n, systime_t timeout) { + size_t n, sysinterval_t timeout) { size_t w = 0; - systime_t deadline; + sysinterval_t deadline; osalDbgCheck(n > 0U); @@ -762,7 +762,7 @@ size_t obqWriteTimeout(output_buffers_queue_t *obqp, const uint8_t *bp, msg = obqGetEmptyBufferTimeoutS(obqp, timeout); } else { - systime_t next_timeout = deadline - osalOsGetSystemTimeX(); + sysinterval_t next_timeout = deadline - osalOsGetSystemTimeX(); /* Handling the case where the system time went past the deadline, in this case next becomes a very high number because the system diff --git a/os/hal/src/hal_can.c b/os/hal/src/hal_can.c index 014d59c70..122e5eb76 100644 --- a/os/hal/src/hal_can.c +++ b/os/hal/src/hal_can.c @@ -233,7 +233,7 @@ bool canTryReceiveI(CANDriver *canp, msg_t canTransmitTimeout(CANDriver *canp, canmbx_t mailbox, const CANTxFrame *ctfp, - systime_t timeout) { + sysinterval_t timeout) { osalDbgCheck((canp != NULL) && (ctfp != NULL) && (mailbox <= (canmbx_t)CAN_TX_MAILBOXES)); @@ -281,7 +281,7 @@ msg_t canTransmitTimeout(CANDriver *canp, msg_t canReceiveTimeout(CANDriver *canp, canmbx_t mailbox, CANRxFrame *crfp, - systime_t timeout) { + sysinterval_t timeout) { osalDbgCheck((canp != NULL) && (crfp != NULL) && (mailbox <= (canmbx_t)CAN_RX_MAILBOXES)); diff --git a/os/hal/src/hal_i2c.c b/os/hal/src/hal_i2c.c index 54a362f0c..02d405daa 100644 --- a/os/hal/src/hal_i2c.c +++ b/os/hal/src/hal_i2c.c @@ -173,7 +173,7 @@ msg_t i2cMasterTransmitTimeout(I2CDriver *i2cp, size_t txbytes, uint8_t *rxbuf, size_t rxbytes, - systime_t timeout) { + sysinterval_t timeout) { msg_t rdymsg; osalDbgCheck((i2cp != NULL) && (addr != 0U) && @@ -222,7 +222,7 @@ msg_t i2cMasterReceiveTimeout(I2CDriver *i2cp, i2caddr_t addr, uint8_t *rxbuf, size_t rxbytes, - systime_t timeout){ + sysinterval_t timeout) { msg_t rdymsg; diff --git a/os/hal/src/hal_mac.c b/os/hal/src/hal_mac.c index 7d0f4cf43..2ae0b677d 100644 --- a/os/hal/src/hal_mac.c +++ b/os/hal/src/hal_mac.c @@ -149,7 +149,7 @@ void macStop(MACDriver *macp) { */ msg_t macWaitTransmitDescriptor(MACDriver *macp, MACTransmitDescriptor *tdp, - systime_t timeout) { + sysinterval_t timeout) { msg_t msg; systime_t now; @@ -157,7 +157,7 @@ msg_t macWaitTransmitDescriptor(MACDriver *macp, osalDbgAssert(macp->state == MAC_ACTIVE, "not active"); while (((msg = mac_lld_get_transmit_descriptor(macp, tdp)) != MSG_OK) && - (timeout > (systime_t)0)) { + (timeout > (sysinterval_t)0)) { osalSysLock(); now = osalOsGetSystemTimeX(); msg = osalThreadEnqueueTimeoutS(&macp->tdqueue, timeout); @@ -209,7 +209,7 @@ void macReleaseTransmitDescriptor(MACTransmitDescriptor *tdp) { */ msg_t macWaitReceiveDescriptor(MACDriver *macp, MACReceiveDescriptor *rdp, - systime_t timeout) { + sysinterval_t timeout) { msg_t msg; systime_t now; @@ -217,7 +217,7 @@ msg_t macWaitReceiveDescriptor(MACDriver *macp, osalDbgAssert(macp->state == MAC_ACTIVE, "not active"); while (((msg = mac_lld_get_receive_descriptor(macp, rdp)) != MSG_OK) && - (timeout > (systime_t)0)) { + (timeout > (sysinterval_t)0)) { osalSysLock(); now = osalOsGetSystemTimeX(); msg = osalThreadEnqueueTimeoutS(&macp->rdqueue, timeout); diff --git a/os/hal/src/hal_pal.c b/os/hal/src/hal_pal.c index b46c9e7ea..3a83005ec 100644 --- a/os/hal/src/hal_pal.c +++ b/os/hal/src/hal_pal.c @@ -167,7 +167,9 @@ void palSetLineCallbackI(ioline_t line, palcallback_t cb, void *arg) { * * @sclass */ -msg_t palWaitPadTimeoutS(ioportid_t port, iopadid_t pad, systime_t timeout) { +msg_t palWaitPadTimeoutS(ioportid_t port, + iopadid_t pad, + sysinterval_t timeout) { palevent_t *pep = pal_lld_get_pad_event(port, pad); return osalThreadEnqueueTimeoutS(&pep->threads, timeout); @@ -186,7 +188,8 @@ msg_t palWaitPadTimeoutS(ioportid_t port, iopadid_t pad, systime_t timeout) { * * @sclass */ -msg_t palWaitLineTimeoutS(ioline_t line, systime_t timeout) { +msg_t palWaitLineTimeoutS(ioline_t line, + sysinterval_t timeout) { palevent_t *pep = pal_lld_get_line_event(line); return osalThreadEnqueueTimeoutS(&pep->threads, timeout); diff --git a/os/hal/src/hal_queues.c b/os/hal/src/hal_queues.c index d0ef6f489..d3ead6998 100644 --- a/os/hal/src/hal_queues.c +++ b/os/hal/src/hal_queues.c @@ -138,7 +138,7 @@ msg_t iqPutI(input_queue_t *iqp, uint8_t b) { * * @api */ -msg_t iqGetTimeout(input_queue_t *iqp, systime_t timeout) { +msg_t iqGetTimeout(input_queue_t *iqp, sysinterval_t timeout) { uint8_t b; osalSysLock(); @@ -194,7 +194,7 @@ msg_t iqGetTimeout(input_queue_t *iqp, systime_t timeout) { * @api */ size_t iqReadTimeout(input_queue_t *iqp, uint8_t *bp, - size_t n, systime_t timeout) { + size_t n, sysinterval_t timeout) { systime_t deadline; qnotify_t nfy = iqp->q_notify; size_t r = 0; @@ -219,7 +219,7 @@ size_t iqReadTimeout(input_queue_t *iqp, uint8_t *bp, msg = osalThreadEnqueueTimeoutS(&iqp->q_waiting, timeout); } else { - systime_t next_timeout = deadline - osalOsGetSystemTimeX(); + sysinterval_t next_timeout = deadline - osalOsGetSystemTimeX(); /* Handling the case where the system time went past the deadline, in this case next becomes a very high number because the system @@ -334,7 +334,7 @@ void oqResetI(output_queue_t *oqp) { * * @api */ -msg_t oqPutTimeout(output_queue_t *oqp, uint8_t b, systime_t timeout) { +msg_t oqPutTimeout(output_queue_t *oqp, uint8_t b, sysinterval_t timeout) { osalSysLock(); @@ -419,7 +419,7 @@ msg_t oqGetI(output_queue_t *oqp) { * @api */ size_t oqWriteTimeout(output_queue_t *oqp, const uint8_t *bp, - size_t n, systime_t timeout) { + size_t n, sysinterval_t timeout) { systime_t deadline; qnotify_t nfy = oqp->q_notify; size_t w = 0; @@ -443,7 +443,7 @@ size_t oqWriteTimeout(output_queue_t *oqp, const uint8_t *bp, msg = osalThreadEnqueueTimeoutS(&oqp->q_waiting, timeout); } else { - systime_t next_timeout = deadline - osalOsGetSystemTimeX(); + sysinterval_t next_timeout = deadline - osalOsGetSystemTimeX(); /* Handling the case where the system time went past the deadline, in this case next becomes a very high number because the system diff --git a/os/hal/src/hal_serial.c b/os/hal/src/hal_serial.c index 5c24c8216..6658a44e0 100644 --- a/os/hal/src/hal_serial.c +++ b/os/hal/src/hal_serial.c @@ -69,22 +69,24 @@ static msg_t _get(void *ip) { return iqGetTimeout(&((SerialDriver *)ip)->iqueue, TIME_INFINITE); } -static msg_t _putt(void *ip, uint8_t b, systime_t timeout) { +static msg_t _putt(void *ip, uint8_t b, sysinterval_t timeout) { return oqPutTimeout(&((SerialDriver *)ip)->oqueue, b, timeout); } -static msg_t _gett(void *ip, systime_t timeout) { +static msg_t _gett(void *ip, sysinterval_t timeout) { return iqGetTimeout(&((SerialDriver *)ip)->iqueue, timeout); } -static size_t _writet(void *ip, const uint8_t *bp, size_t n, systime_t timeout) { +static size_t _writet(void *ip, const uint8_t *bp, size_t n, + sysinterval_t timeout) { return oqWriteTimeout(&((SerialDriver *)ip)->oqueue, bp, n, timeout); } -static size_t _readt(void *ip, uint8_t *bp, size_t n, systime_t timeout) { +static size_t _readt(void *ip, uint8_t *bp, size_t n, + sysinterval_t timeout) { return iqReadTimeout(&((SerialDriver *)ip)->iqueue, bp, n, timeout); } diff --git a/os/hal/src/hal_serial_usb.c b/os/hal/src/hal_serial_usb.c index 1af9b50a3..f2dcd6c32 100644 --- a/os/hal/src/hal_serial_usb.c +++ b/os/hal/src/hal_serial_usb.c @@ -104,22 +104,24 @@ static msg_t _get(void *ip) { return ibqGetTimeout(&((SerialUSBDriver *)ip)->ibqueue, TIME_INFINITE); } -static msg_t _putt(void *ip, uint8_t b, systime_t timeout) { +static msg_t _putt(void *ip, uint8_t b, sysinterval_t timeout) { return obqPutTimeout(&((SerialUSBDriver *)ip)->obqueue, b, timeout); } -static msg_t _gett(void *ip, systime_t timeout) { +static msg_t _gett(void *ip, sysinterval_t timeout) { return ibqGetTimeout(&((SerialUSBDriver *)ip)->ibqueue, timeout); } -static size_t _writet(void *ip, const uint8_t *bp, size_t n, systime_t timeout) { +static size_t _writet(void *ip, const uint8_t *bp, size_t n, + sysinterval_t timeout) { return obqWriteTimeout(&((SerialUSBDriver *)ip)->obqueue, bp, n, timeout); } -static size_t _readt(void *ip, uint8_t *bp, size_t n, systime_t timeout) { +static size_t _readt(void *ip, uint8_t *bp, size_t n, + sysinterval_t timeout) { return ibqReadTimeout(&((SerialUSBDriver *)ip)->ibqueue, bp, n, timeout); } diff --git a/os/hal/src/hal_uart.c b/os/hal/src/hal_uart.c index 89276f28f..ac3e4df3e 100644 --- a/os/hal/src/hal_uart.c +++ b/os/hal/src/hal_uart.c @@ -367,7 +367,7 @@ size_t uartStopReceiveI(UARTDriver *uartp) { * @api */ msg_t uartSendTimeout(UARTDriver *uartp, size_t *np, - const void *txbuf, systime_t timeout) { + const void *txbuf, sysinterval_t timeout) { msg_t msg; osalDbgCheck((uartp != NULL) && (*np > 0U) && (txbuf != NULL)); @@ -412,7 +412,7 @@ msg_t uartSendTimeout(UARTDriver *uartp, size_t *np, * @api */ msg_t uartSendFullTimeout(UARTDriver *uartp, size_t *np, - const void *txbuf, systime_t timeout) { + const void *txbuf, sysinterval_t timeout) { msg_t msg; osalDbgCheck((uartp != NULL) && (*np > 0U) && (txbuf != NULL)); @@ -459,7 +459,7 @@ msg_t uartSendFullTimeout(UARTDriver *uartp, size_t *np, * @api */ msg_t uartReceiveTimeout(UARTDriver *uartp, size_t *np, - void *rxbuf, systime_t timeout) { + void *rxbuf, sysinterval_t timeout) { msg_t msg; osalDbgCheck((uartp != NULL) && (*np > 0U) && (rxbuf != NULL)); -- cgit v1.2.3