Skip to content

Commit 5d80f9e

Browse files
committed
STM32: remove compilation warning
1 parent 15ec24e commit 5d80f9e

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

targets/TARGET_STM/can_api.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@ void can_irq_set(can_t *obj, CanIrqType type, uint32_t enable)
513513
#include "can_device.h" // Specific to STM32 serie
514514
#include <math.h>
515515
#include <string.h>
516+
#include <inttypes.h>
516517

517518
static uint32_t can_irq_ids[CAN_NUM] = {0};
518519
static can_irq_handler irq_handler;
@@ -743,7 +744,7 @@ int can_frequency(can_t *obj, int f)
743744
}
744745
}
745746
if (status == 0) {
746-
error("can ESR 0x%04x.%04x + timeout status %d", (can->ESR & 0xFFFF0000) >> 16, (can->ESR & 0xFFFF), status);
747+
error("can ESR 0x%04" PRIx32 ".%04" PRIx32 " + timeout status %d", (can->ESR & 0xFFFF0000) >> 16, (can->ESR & 0xFFFF), status);
747748
}
748749
} else {
749750
error("can init request timeout\n");

targets/TARGET_STM/gpio_irq_api.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#if DEVICE_INTERRUPTIN
3232

3333
#include <stdbool.h>
34+
#include <inttypes.h>
3435
#include "cmsis.h"
3536
#include "gpio_irq_api.h"
3637
#include "pinmap.h"
@@ -125,7 +126,7 @@ static void handle_interrupt_in(uint32_t irq_index, uint32_t max_num_pin_line)
125126
}
126127
}
127128
}
128-
error("Unexpected Spurious interrupt, index %ld\r\n", irq_index);
129+
error("Unexpected Spurious interrupt index %" PRIu32 "\n", irq_index);
129130
}
130131

131132

targets/TARGET_STM/i2c_api.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535

3636
#if DEVICE_I2C
3737

38+
#include <string.h>
3839
#include "cmsis.h"
3940
#include "pinmap.h"
4041
#include "PeripheralPins.h"

0 commit comments

Comments
 (0)