From 073c82e56824d84af2dadba3aa16063998aa4576 Mon Sep 17 00:00:00 2001 From: jeromecoutant Date: Thu, 20 May 2021 11:04:36 +0200 Subject: [PATCH 1/2] STM32: correct __cplusplus brackets in can_device.h --- targets/TARGET_STM/TARGET_STM32F0/can_device.h | 4 ++++ targets/TARGET_STM/TARGET_STM32F1/can_device.h | 4 ++++ targets/TARGET_STM/TARGET_STM32F2/can_device.h | 4 ++++ targets/TARGET_STM/TARGET_STM32F3/can_device.h | 4 ++++ targets/TARGET_STM/TARGET_STM32F4/can_device.h | 4 ++++ targets/TARGET_STM/TARGET_STM32F7/can_device.h | 4 ++++ targets/TARGET_STM/TARGET_STM32L4/can_device.h | 4 ++++ targets/TARGET_STM/TARGET_STM32L5/can_device.h | 4 ++++ 8 files changed, 32 insertions(+) diff --git a/targets/TARGET_STM/TARGET_STM32F0/can_device.h b/targets/TARGET_STM/TARGET_STM32F0/can_device.h index cd8bee00b92..86ab3fb643f 100644 --- a/targets/TARGET_STM/TARGET_STM32F0/can_device.h +++ b/targets/TARGET_STM/TARGET_STM32F0/can_device.h @@ -40,4 +40,8 @@ extern "C" { #endif // DEVICE_CAN +#ifdef __cplusplus +} +#endif + #endif diff --git a/targets/TARGET_STM/TARGET_STM32F1/can_device.h b/targets/TARGET_STM/TARGET_STM32F1/can_device.h index f47f7bd6444..77323a22b96 100644 --- a/targets/TARGET_STM/TARGET_STM32F1/can_device.h +++ b/targets/TARGET_STM/TARGET_STM32F1/can_device.h @@ -41,4 +41,8 @@ extern "C" { #endif // DEVICE_CAN +#ifdef __cplusplus +} +#endif + #endif diff --git a/targets/TARGET_STM/TARGET_STM32F2/can_device.h b/targets/TARGET_STM/TARGET_STM32F2/can_device.h index 8e7730e0d89..aad22f4ba68 100644 --- a/targets/TARGET_STM/TARGET_STM32F2/can_device.h +++ b/targets/TARGET_STM/TARGET_STM32F2/can_device.h @@ -52,4 +52,8 @@ extern "C" { #endif // DEVICE_CAN +#ifdef __cplusplus +} +#endif + #endif diff --git a/targets/TARGET_STM/TARGET_STM32F3/can_device.h b/targets/TARGET_STM/TARGET_STM32F3/can_device.h index 846e081cf16..1abc4f88dba 100644 --- a/targets/TARGET_STM/TARGET_STM32F3/can_device.h +++ b/targets/TARGET_STM/TARGET_STM32F3/can_device.h @@ -41,4 +41,8 @@ extern "C" { #endif // DEVICE_CAN +#ifdef __cplusplus +} +#endif + #endif diff --git a/targets/TARGET_STM/TARGET_STM32F4/can_device.h b/targets/TARGET_STM/TARGET_STM32F4/can_device.h index 1a12fec2828..ece0a52017f 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/can_device.h +++ b/targets/TARGET_STM/TARGET_STM32F4/can_device.h @@ -70,4 +70,8 @@ extern "C" { #endif // DEVICE_CAN +#ifdef __cplusplus +} +#endif + #endif diff --git a/targets/TARGET_STM/TARGET_STM32F7/can_device.h b/targets/TARGET_STM/TARGET_STM32F7/can_device.h index 006bd780740..31a48116844 100644 --- a/targets/TARGET_STM/TARGET_STM32F7/can_device.h +++ b/targets/TARGET_STM/TARGET_STM32F7/can_device.h @@ -71,4 +71,8 @@ extern "C" { #endif // DEVICE_CAN +#ifdef __cplusplus +} +#endif + #endif diff --git a/targets/TARGET_STM/TARGET_STM32L4/can_device.h b/targets/TARGET_STM/TARGET_STM32L4/can_device.h index 3a213007055..9759d2ac21a 100644 --- a/targets/TARGET_STM/TARGET_STM32L4/can_device.h +++ b/targets/TARGET_STM/TARGET_STM32L4/can_device.h @@ -42,4 +42,8 @@ extern "C" { #endif // DEVICE_CAN +#ifdef __cplusplus +} +#endif + #endif diff --git a/targets/TARGET_STM/TARGET_STM32L5/can_device.h b/targets/TARGET_STM/TARGET_STM32L5/can_device.h index 357b6ec561c..17f055456f4 100644 --- a/targets/TARGET_STM/TARGET_STM32L5/can_device.h +++ b/targets/TARGET_STM/TARGET_STM32L5/can_device.h @@ -39,4 +39,8 @@ extern "C" { #endif // DEVICE_CAN +#ifdef __cplusplus +} +#endif + #endif From 81dc8f8605d0d82ba619c78c11b1b2d769795c68 Mon Sep 17 00:00:00 2001 From: jeromecoutant Date: Mon, 24 May 2021 14:47:05 +0200 Subject: [PATCH 2/2] STM32: correct __cplusplus brackets in ci2c_device.h --- targets/TARGET_STM/TARGET_STM32F0/i2c_device.h | 4 +++- targets/TARGET_STM/TARGET_STM32F1/i2c_device.h | 4 ++++ targets/TARGET_STM/TARGET_STM32F2/i2c_device.h | 4 ++++ targets/TARGET_STM/TARGET_STM32F3/i2c_device.h | 4 +++- targets/TARGET_STM/TARGET_STM32F4/i2c_device.h | 4 ++++ targets/TARGET_STM/TARGET_STM32F7/i2c_device.h | 4 +++- targets/TARGET_STM/TARGET_STM32G0/i2c_device.h | 4 +++- targets/TARGET_STM/TARGET_STM32G4/i2c_device.h | 4 +++- targets/TARGET_STM/TARGET_STM32H7/i2c_device.h | 4 +++- targets/TARGET_STM/TARGET_STM32L0/i2c_device.h | 4 +++- targets/TARGET_STM/TARGET_STM32L1/i2c_device.h | 4 ++++ targets/TARGET_STM/TARGET_STM32L4/i2c_device.h | 4 +++- targets/TARGET_STM/TARGET_STM32L5/i2c_device.h | 4 +++- targets/TARGET_STM/TARGET_STM32WB/i2c_device.h | 4 +++- targets/TARGET_STM/TARGET_STM32WL/i2c_device.h | 4 +++- 15 files changed, 49 insertions(+), 11 deletions(-) diff --git a/targets/TARGET_STM/TARGET_STM32F0/i2c_device.h b/targets/TARGET_STM/TARGET_STM32F0/i2c_device.h index 1fb9f83404c..53137254083 100644 --- a/targets/TARGET_STM/TARGET_STM32F0/i2c_device.h +++ b/targets/TARGET_STM/TARGET_STM32F0/i2c_device.h @@ -53,8 +53,10 @@ uint32_t i2c_get_timing(I2CName i2c, int hz); void i2c_compute_presc_scldel_sdadel(uint32_t clock_src_freq, uint32_t I2C_speed); uint32_t i2c_compute_scll_sclh(uint32_t clock_src_freq, uint32_t I2C_speed); +#endif // DEVICE_I2C + #ifdef __cplusplus } #endif -#endif // DEVICE_I2C + #endif diff --git a/targets/TARGET_STM/TARGET_STM32F1/i2c_device.h b/targets/TARGET_STM/TARGET_STM32F1/i2c_device.h index 678d56b01ae..f99afc7267d 100644 --- a/targets/TARGET_STM/TARGET_STM32F1/i2c_device.h +++ b/targets/TARGET_STM/TARGET_STM32F1/i2c_device.h @@ -45,4 +45,8 @@ extern "C" { #endif // DEVICE_I2C +#ifdef __cplusplus +} +#endif + #endif diff --git a/targets/TARGET_STM/TARGET_STM32F2/i2c_device.h b/targets/TARGET_STM/TARGET_STM32F2/i2c_device.h index 9de87741881..8c3c90dd5cb 100644 --- a/targets/TARGET_STM/TARGET_STM32F2/i2c_device.h +++ b/targets/TARGET_STM/TARGET_STM32F2/i2c_device.h @@ -44,4 +44,8 @@ extern "C" { #endif // DEVICE_I2C +#ifdef __cplusplus +} +#endif + #endif diff --git a/targets/TARGET_STM/TARGET_STM32F3/i2c_device.h b/targets/TARGET_STM/TARGET_STM32F3/i2c_device.h index 7e19708eb33..8239c8f42f8 100644 --- a/targets/TARGET_STM/TARGET_STM32F3/i2c_device.h +++ b/targets/TARGET_STM/TARGET_STM32F3/i2c_device.h @@ -67,8 +67,10 @@ uint32_t i2c_get_timing(I2CName i2c, int hz); void i2c_compute_presc_scldel_sdadel(uint32_t clock_src_freq, uint32_t I2C_speed); uint32_t i2c_compute_scll_sclh(uint32_t clock_src_freq, uint32_t I2C_speed); +#endif // DEVICE_I2C + #ifdef __cplusplus } #endif -#endif // DEVICE_I2C + #endif diff --git a/targets/TARGET_STM/TARGET_STM32F4/i2c_device.h b/targets/TARGET_STM/TARGET_STM32F4/i2c_device.h index fc229220ed2..604b7bafc86 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/i2c_device.h +++ b/targets/TARGET_STM/TARGET_STM32F4/i2c_device.h @@ -31,4 +31,8 @@ extern "C" { #endif // DEVICE_I2C +#ifdef __cplusplus +} +#endif + #endif diff --git a/targets/TARGET_STM/TARGET_STM32F7/i2c_device.h b/targets/TARGET_STM/TARGET_STM32F7/i2c_device.h index 66f9717bed7..144952c9bbe 100644 --- a/targets/TARGET_STM/TARGET_STM32F7/i2c_device.h +++ b/targets/TARGET_STM/TARGET_STM32F7/i2c_device.h @@ -62,8 +62,10 @@ uint32_t i2c_get_timing(I2CName i2c, int hz); void i2c_compute_presc_scldel_sdadel(uint32_t clock_src_freq, uint32_t I2C_speed); uint32_t i2c_compute_scll_sclh(uint32_t clock_src_freq, uint32_t I2C_speed); +#endif // DEVICE_I2C + #ifdef __cplusplus } #endif -#endif // DEVICE_I2C + #endif diff --git a/targets/TARGET_STM/TARGET_STM32G0/i2c_device.h b/targets/TARGET_STM/TARGET_STM32G0/i2c_device.h index 4b189f7abc1..c4abb77a26b 100644 --- a/targets/TARGET_STM/TARGET_STM32G0/i2c_device.h +++ b/targets/TARGET_STM/TARGET_STM32G0/i2c_device.h @@ -52,8 +52,10 @@ uint32_t i2c_get_timing(I2CName i2c, int hz); void i2c_compute_presc_scldel_sdadel(uint32_t clock_src_freq, uint32_t I2C_speed); uint32_t i2c_compute_scll_sclh(uint32_t clock_src_freq, uint32_t I2C_speed); +#endif // DEVICE_I2C + #ifdef __cplusplus } #endif -#endif // DEVICE_I2C + #endif diff --git a/targets/TARGET_STM/TARGET_STM32G4/i2c_device.h b/targets/TARGET_STM/TARGET_STM32G4/i2c_device.h index dada0818332..51abe0c234f 100644 --- a/targets/TARGET_STM/TARGET_STM32G4/i2c_device.h +++ b/targets/TARGET_STM/TARGET_STM32G4/i2c_device.h @@ -48,8 +48,10 @@ uint32_t i2c_get_timing(I2CName i2c, int hz); void i2c_compute_presc_scldel_sdadel(uint32_t clock_src_freq, uint32_t I2C_speed); uint32_t i2c_compute_scll_sclh(uint32_t clock_src_freq, uint32_t I2C_speed); +#endif // DEVICE_I2C + #ifdef __cplusplus } #endif -#endif // DEVICE_I2C + #endif diff --git a/targets/TARGET_STM/TARGET_STM32H7/i2c_device.h b/targets/TARGET_STM/TARGET_STM32H7/i2c_device.h index cc56874f269..1c2aa0632ff 100644 --- a/targets/TARGET_STM/TARGET_STM32H7/i2c_device.h +++ b/targets/TARGET_STM/TARGET_STM32H7/i2c_device.h @@ -48,8 +48,10 @@ uint32_t i2c_get_timing(I2CName i2c, int hz); void i2c_compute_presc_scldel_sdadel(uint32_t clock_src_freq, uint32_t I2C_speed); uint32_t i2c_compute_scll_sclh(uint32_t clock_src_freq, uint32_t I2C_speed); +#endif // DEVICE_I2C + #ifdef __cplusplus } #endif -#endif // DEVICE_I2C + #endif diff --git a/targets/TARGET_STM/TARGET_STM32L0/i2c_device.h b/targets/TARGET_STM/TARGET_STM32L0/i2c_device.h index b5e50a17eb7..2d854005010 100644 --- a/targets/TARGET_STM/TARGET_STM32L0/i2c_device.h +++ b/targets/TARGET_STM/TARGET_STM32L0/i2c_device.h @@ -59,8 +59,10 @@ uint32_t i2c_get_timing(I2CName i2c, int hz); void i2c_compute_presc_scldel_sdadel(uint32_t clock_src_freq, uint32_t I2C_speed); uint32_t i2c_compute_scll_sclh(uint32_t clock_src_freq, uint32_t I2C_speed); +#endif // DEVICE_I2C + #ifdef __cplusplus } #endif -#endif // DEVICE_I2C + #endif diff --git a/targets/TARGET_STM/TARGET_STM32L1/i2c_device.h b/targets/TARGET_STM/TARGET_STM32L1/i2c_device.h index 742727e89c7..39a831aecef 100644 --- a/targets/TARGET_STM/TARGET_STM32L1/i2c_device.h +++ b/targets/TARGET_STM/TARGET_STM32L1/i2c_device.h @@ -31,4 +31,8 @@ extern "C" { #endif // DEVICE_I2C +#ifdef __cplusplus +} +#endif + #endif diff --git a/targets/TARGET_STM/TARGET_STM32L4/i2c_device.h b/targets/TARGET_STM/TARGET_STM32L4/i2c_device.h index 9cd57129543..eeb4c436af3 100644 --- a/targets/TARGET_STM/TARGET_STM32L4/i2c_device.h +++ b/targets/TARGET_STM/TARGET_STM32L4/i2c_device.h @@ -62,8 +62,10 @@ uint32_t i2c_get_timing(I2CName i2c, int hz); void i2c_compute_presc_scldel_sdadel(uint32_t clock_src_freq, uint32_t I2C_speed); uint32_t i2c_compute_scll_sclh(uint32_t clock_src_freq, uint32_t I2C_speed); +#endif // DEVICE_I2C + #ifdef __cplusplus } #endif -#endif // DEVICE_I2C + #endif diff --git a/targets/TARGET_STM/TARGET_STM32L5/i2c_device.h b/targets/TARGET_STM/TARGET_STM32L5/i2c_device.h index c3d1a2797a1..0029b7e954e 100644 --- a/targets/TARGET_STM/TARGET_STM32L5/i2c_device.h +++ b/targets/TARGET_STM/TARGET_STM32L5/i2c_device.h @@ -48,8 +48,10 @@ uint32_t i2c_get_timing(I2CName i2c, int hz); void i2c_compute_presc_scldel_sdadel(uint32_t clock_src_freq, uint32_t I2C_speed); uint32_t i2c_compute_scll_sclh(uint32_t clock_src_freq, uint32_t I2C_speed); +#endif // DEVICE_I2C + #ifdef __cplusplus } #endif -#endif // DEVICE_I2C + #endif diff --git a/targets/TARGET_STM/TARGET_STM32WB/i2c_device.h b/targets/TARGET_STM/TARGET_STM32WB/i2c_device.h index 53cdcff5ae7..df91b4b409e 100644 --- a/targets/TARGET_STM/TARGET_STM32WB/i2c_device.h +++ b/targets/TARGET_STM/TARGET_STM32WB/i2c_device.h @@ -55,8 +55,10 @@ uint32_t i2c_get_timing(I2CName i2c, int hz); void i2c_compute_presc_scldel_sdadel(uint32_t clock_src_freq, uint32_t I2C_speed); uint32_t i2c_compute_scll_sclh(uint32_t clock_src_freq, uint32_t I2C_speed); +#endif // DEVICE_I2C + #ifdef __cplusplus } #endif -#endif // DEVICE_I2C + #endif diff --git a/targets/TARGET_STM/TARGET_STM32WL/i2c_device.h b/targets/TARGET_STM/TARGET_STM32WL/i2c_device.h index ef7df02404e..a1c444a259d 100644 --- a/targets/TARGET_STM/TARGET_STM32WL/i2c_device.h +++ b/targets/TARGET_STM/TARGET_STM32WL/i2c_device.h @@ -47,8 +47,10 @@ uint32_t i2c_get_timing(I2CName i2c, int hz); void i2c_compute_presc_scldel_sdadel(uint32_t clock_src_freq, uint32_t I2C_speed); uint32_t i2c_compute_scll_sclh(uint32_t clock_src_freq, uint32_t I2C_speed); +#endif // DEVICE_I2C + #ifdef __cplusplus } #endif -#endif // DEVICE_I2C + #endif