• R/O
  • SSH
  • HTTPS

chibios: Commit


Commit MetaInfo

Révision14544 (tree)
l'heure2021-06-13 18:59:48
Auteurgdisirio

Message de Log

MISRA-related fixes.

Change Summary

Modification

--- trunk/doc/hal/reports/misra.txt (revision 14543)
+++ trunk/doc/hal/reports/misra.txt (revision 14544)
@@ -108,3 +108,6 @@
108108 --- Module: ..\..\..\os\hal\templates\hal_wdg_lld.c (C)
109109
110110 --- Module: ..\..\..\os\hal\templates\hal_wspi_lld.c (C)
111+
112+executed 6-13-2021
113+
--- trunk/os/hal/include/hal_sio.h (revision 14543)
+++ trunk/os/hal/include/hal_sio.h (revision 14544)
@@ -468,6 +468,7 @@
468468 void sioStop(SIODriver *siop);
469469 void sioStartOperation(SIODriver *siop, const SIOOperation *operation);
470470 void sioStopOperation(SIODriver *siop);
471+ sio_events_mask_t sioGetAndClearEvents(SIODriver *siop);
471472 size_t sioAsyncRead(SIODriver *siop, uint8_t *buffer, size_t n);
472473 size_t sioAsyncWrite(SIODriver *siop, const uint8_t *buffer, size_t n);
473474 #if (SIO_USE_SYNCHRONIZATION == TRUE) || defined(__DOXYGEN__)
--- trunk/os/hal/src/hal_rtc.c (revision 14543)
+++ trunk/os/hal/src/hal_rtc.c (revision 14544)
@@ -246,8 +246,8 @@
246246 /* Day of the year calculation.*/
247247 year = timp->tm_year + 1900;
248248 timp->tm_yday = timp->tm_mday - 1;
249- timp->tm_yday += accu_month_len[timp->tm_mon];
250- is_leap_year = ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0);
249+ timp->tm_yday += (int)accu_month_len[timp->tm_mon];
250+ is_leap_year = (((year % 4) == 0) && ((year % 100) != 0)) || ((year % 400) == 0);
251251 if (is_leap_year && (timp->tm_mon > 1)) {
252252 timp->tm_yday++;
253253 }
@@ -313,7 +313,7 @@
313313 if (hour == 24U) {
314314 hour = 0U;
315315 day += 1U;
316- if (day > month_len[month - 1U]) {
316+ if (day > (uint32_t)month_len[month - 1U]) {
317317 day = 1U;
318318 month += 1U;
319319 }
--- trunk/os/hal/src/hal_sio.c (revision 14543)
+++ trunk/os/hal/src/hal_sio.c (revision 14544)
@@ -185,7 +185,8 @@
185185 osalDbgAssert(false, "invalid CTL operation");
186186 break;
187187 default:
188- break;
188+ /* Delegating to the LLD if supported.*/
189+ return sio_lld_control(siop, operation, arg);
189190 }
190191 return MSG_OK;
191192 }
@@ -453,7 +454,11 @@
453454
454455 osalDbgAssert(siop->state == SIO_ACTIVE, "invalid state");
455456
457+ /*lint -save -e506 -e681 [2.1] Silencing this error because it is
458+ tested with a template implementation of sio_lld_is_rx_empty() which
459+ is constant.*/
456460 while (sio_lld_is_rx_empty(siop)) {
461+ /*lint -restore*/
457462 msg = osalThreadSuspendTimeoutS(&siop->sync_rx, timeout);
458463 }
459464
@@ -484,7 +489,11 @@
484489
485490 osalDbgAssert(siop->state == SIO_ACTIVE, "invalid state");
486491
492+ /*lint -save -e506 -e681 [2.1] Silencing this error because it is
493+ tested with a template implementation of sio_lld_is_tx_full() which
494+ is constant.*/
487495 while (sio_lld_is_tx_full(siop)) {
496+ /*lint -restore*/
488497 msg = osalThreadSuspendTimeoutS(&siop->sync_tx, timeout);
489498 }
490499
@@ -512,7 +521,11 @@
512521
513522 osalDbgAssert(siop->state == SIO_ACTIVE, "invalid state");
514523
524+ /*lint -save -e506 -e774 [2.1, 14.3] Silencing this error because
525+ it is tested with a template implementation of sio_lld_is_tx_ongoing()
526+ which is constant.*/
515527 if (sio_lld_is_tx_ongoing(siop)) {
528+ /*lint -restore*/
516529 msg = osalThreadSuspendTimeoutS(&siop->sync_txend, timeout);
517530 }
518531 else {
--- trunk/os/hal/templates/hal_sio_lld.c (revision 14543)
+++ trunk/os/hal/templates/hal_sio_lld.c (revision 14544)
@@ -204,7 +204,7 @@
204204 * @notapi
205205 */
206206 msg_t sio_lld_get(SIODriver *siop) {
207- msg_t msg = 0U;
207+ msg_t msg = (msg_t)0;
208208
209209 (void)siop;
210210
--- trunk/os/hal/templates/hal_sio_lld.h (revision 14543)
+++ trunk/os/hal/templates/hal_sio_lld.h (revision 14544)
@@ -69,12 +69,14 @@
6969 /**
7070 * @brief Low level fields of the SIO driver structure.
7171 */
72-#define sio_lld_driver_fields
72+#define sio_lld_driver_fields \
73+ uint32_t dummy
7374
7475 /**
7576 * @brief Low level fields of the SIO configuration structure.
7677 */
77-#define sio_lld_config_fields
78+#define sio_lld_config_fields \
79+ uint32_t dummy
7880
7981 /**
8082 * @brief Determines the state of the RX FIFO.
@@ -86,7 +88,7 @@
8688 *
8789 * @notapi
8890 */
89-#define sio_lld_is_rx_empty(siop) true
91+#define sio_lld_is_rx_empty(siop) false
9092
9193 /**
9294 * @brief Determines the state of the TX FIFO.
@@ -98,7 +100,7 @@
98100 *
99101 * @notapi
100102 */
101-#define sio_lld_is_tx_full(siop) true
103+#define sio_lld_is_tx_full(siop) false
102104
103105 /**
104106 * @brief Determines the transmission state.
Afficher sur ancien navigateur de dépôt.