MISRA-related fixes.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@14544 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
parent
bf475d92c6
commit
eef7c4e7fc
|
@ -108,3 +108,6 @@
|
|||
--- Module: ..\..\..\os\hal\templates\hal_wdg_lld.c (C)
|
||||
|
||||
--- Module: ..\..\..\os\hal\templates\hal_wspi_lld.c (C)
|
||||
|
||||
executed 6-13-2021
|
||||
|
||||
|
|
|
@ -468,6 +468,7 @@ extern "C" {
|
|||
void sioStop(SIODriver *siop);
|
||||
void sioStartOperation(SIODriver *siop, const SIOOperation *operation);
|
||||
void sioStopOperation(SIODriver *siop);
|
||||
sio_events_mask_t sioGetAndClearEvents(SIODriver *siop);
|
||||
size_t sioAsyncRead(SIODriver *siop, uint8_t *buffer, size_t n);
|
||||
size_t sioAsyncWrite(SIODriver *siop, const uint8_t *buffer, size_t n);
|
||||
#if (SIO_USE_SYNCHRONIZATION == TRUE) || defined(__DOXYGEN__)
|
||||
|
|
|
@ -246,8 +246,8 @@ void rtcConvertDateTimeToStructTm(const RTCDateTime *timespec,
|
|||
/* Day of the year calculation.*/
|
||||
year = timp->tm_year + 1900;
|
||||
timp->tm_yday = timp->tm_mday - 1;
|
||||
timp->tm_yday += accu_month_len[timp->tm_mon];
|
||||
is_leap_year = ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0);
|
||||
timp->tm_yday += (int)accu_month_len[timp->tm_mon];
|
||||
is_leap_year = (((year % 4) == 0) && ((year % 100) != 0)) || ((year % 400) == 0);
|
||||
if (is_leap_year && (timp->tm_mon > 1)) {
|
||||
timp->tm_yday++;
|
||||
}
|
||||
|
@ -313,7 +313,7 @@ uint32_t rtcConvertDateTimeToFAT(const RTCDateTime *timespec) {
|
|||
if (hour == 24U) {
|
||||
hour = 0U;
|
||||
day += 1U;
|
||||
if (day > month_len[month - 1U]) {
|
||||
if (day > (uint32_t)month_len[month - 1U]) {
|
||||
day = 1U;
|
||||
month += 1U;
|
||||
}
|
||||
|
|
|
@ -185,7 +185,8 @@ static msg_t __ctl(void *ip, unsigned int operation, void *arg) {
|
|||
osalDbgAssert(false, "invalid CTL operation");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
/* Delegating to the LLD if supported.*/
|
||||
return sio_lld_control(siop, operation, arg);
|
||||
}
|
||||
return MSG_OK;
|
||||
}
|
||||
|
@ -453,7 +454,11 @@ msg_t sioSynchronizeRX(SIODriver *siop, sysinterval_t timeout) {
|
|||
|
||||
osalDbgAssert(siop->state == SIO_ACTIVE, "invalid state");
|
||||
|
||||
/*lint -save -e506 -e681 [2.1] Silencing this error because it is
|
||||
tested with a template implementation of sio_lld_is_rx_empty() which
|
||||
is constant.*/
|
||||
while (sio_lld_is_rx_empty(siop)) {
|
||||
/*lint -restore*/
|
||||
msg = osalThreadSuspendTimeoutS(&siop->sync_rx, timeout);
|
||||
}
|
||||
|
||||
|
@ -484,7 +489,11 @@ msg_t sioSynchronizeTX(SIODriver *siop, sysinterval_t timeout) {
|
|||
|
||||
osalDbgAssert(siop->state == SIO_ACTIVE, "invalid state");
|
||||
|
||||
/*lint -save -e506 -e681 [2.1] Silencing this error because it is
|
||||
tested with a template implementation of sio_lld_is_tx_full() which
|
||||
is constant.*/
|
||||
while (sio_lld_is_tx_full(siop)) {
|
||||
/*lint -restore*/
|
||||
msg = osalThreadSuspendTimeoutS(&siop->sync_tx, timeout);
|
||||
}
|
||||
|
||||
|
@ -512,7 +521,11 @@ msg_t sioSynchronizeTXEnd(SIODriver *siop, sysinterval_t timeout) {
|
|||
|
||||
osalDbgAssert(siop->state == SIO_ACTIVE, "invalid state");
|
||||
|
||||
/*lint -save -e506 -e774 [2.1, 14.3] Silencing this error because
|
||||
it is tested with a template implementation of sio_lld_is_tx_ongoing()
|
||||
which is constant.*/
|
||||
if (sio_lld_is_tx_ongoing(siop)) {
|
||||
/*lint -restore*/
|
||||
msg = osalThreadSuspendTimeoutS(&siop->sync_txend, timeout);
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -204,7 +204,7 @@ size_t sio_lld_write(SIODriver *siop, const uint8_t *buffer, size_t n) {
|
|||
* @notapi
|
||||
*/
|
||||
msg_t sio_lld_get(SIODriver *siop) {
|
||||
msg_t msg = 0U;
|
||||
msg_t msg = (msg_t)0;
|
||||
|
||||
(void)siop;
|
||||
|
||||
|
|
|
@ -69,12 +69,14 @@ typedef uint32_t sio_events_mask_t;
|
|||
/**
|
||||
* @brief Low level fields of the SIO driver structure.
|
||||
*/
|
||||
#define sio_lld_driver_fields
|
||||
#define sio_lld_driver_fields \
|
||||
uint32_t dummy
|
||||
|
||||
/**
|
||||
* @brief Low level fields of the SIO configuration structure.
|
||||
*/
|
||||
#define sio_lld_config_fields
|
||||
#define sio_lld_config_fields \
|
||||
uint32_t dummy
|
||||
|
||||
/**
|
||||
* @brief Determines the state of the RX FIFO.
|
||||
|
@ -86,7 +88,7 @@ typedef uint32_t sio_events_mask_t;
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
#define sio_lld_is_rx_empty(siop) true
|
||||
#define sio_lld_is_rx_empty(siop) false
|
||||
|
||||
/**
|
||||
* @brief Determines the state of the TX FIFO.
|
||||
|
@ -98,7 +100,7 @@ typedef uint32_t sio_events_mask_t;
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
#define sio_lld_is_tx_full(siop) true
|
||||
#define sio_lld_is_tx_full(siop) false
|
||||
|
||||
/**
|
||||
* @brief Determines the transmission state.
|
||||
|
|
Loading…
Reference in New Issue