Skip to content

Commit 7af8a23

Browse files
committed
Use macro for computing size of array.
1 parent 3609c29 commit 7af8a23

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ports/stm/supervisor/port.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ condition and generating hardware reset or using Go command to execute user code
291291
HAL_DeInit();
292292

293293
// Disable all pending interrupts using NVIC
294-
for (uint8_t i = 0; i < (sizeof(NVIC->ICER) / sizeof(NVIC->ICER[0])); ++i) {
294+
for (uint8_t i = 0; i < MP_ARRAY_SIZE(NVIC->ICER); ++i) {
295295
NVIC->ICER[i] = 0xFFFFFFFF;
296296
}
297297

@@ -302,7 +302,7 @@ condition and generating hardware reset or using Go command to execute user code
302302
__ISB();
303303

304304
// Clear all pending interrupts using NVIC
305-
for (uint8_t i = 0; i < (sizeof(NVIC->ICPR) / sizeof(NVIC->ICPR[0])); ++i) {
305+
for (uint8_t i = 0; i < MP_ARRAY_SIZE(NVIC->ICPR); ++i) {
306306
NVIC->ICPR[i] = 0xFFFFFFFF;
307307
}
308308

0 commit comments

Comments
 (0)