]> granicus.if.org Git - esp-idf/commitdiff
bootloader_support: Add C++ header guards
authorAngus Gratton <angus@espressif.com>
Wed, 26 Jun 2019 01:02:15 +0000 (11:02 +1000)
committerAngus Gratton <gus@projectgus.com>
Wed, 26 Jun 2019 01:26:56 +0000 (11:26 +1000)
As reported on forum https://esp32.com/viewtopic.php?f=13&t=11173&p=45470

components/bootloader_support/include/bootloader_clock.h
components/bootloader_support/include/bootloader_common.h
components/bootloader_support/include/bootloader_random.h
components/bootloader_support/include/bootloader_util.h
components/bootloader_support/include/esp_flash_encrypt.h
components/bootloader_support/include/esp_image_format.h
components/bootloader_support/include/esp_secure_boot.h

index 9eaba46a8cd7ebd2260b88e83e17e2f561da3a9c..b07d7c98229d81c375ea851579c4d081836a0450 100644 (file)
 
 #pragma once
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /** @brief Configure clocks for early boot
  *
  * Called by bootloader, or by the app if the bootloader version is old (pre v2.1).
  */
 void bootloader_clock_configure(void);
+
+#ifdef __cplusplus
+}
+#endif
index eb5864125fc2c9c55a2ddf4e4abe33178200491e..2475d842a5dd51d4c747c079cd072b1b2d07db2a 100644 (file)
 #include "esp_flash_partitions.h"
 #include "esp_image_format.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /// Type of hold a GPIO in low state
 typedef enum {
     GPIO_LONG_HOLD  = 1,    /*!< The long hold GPIO */
@@ -141,3 +145,7 @@ esp_err_t bootloader_common_get_partition_description(const esp_partition_pos_t
  * @brief Configure VDDSDIO, call this API to rise VDDSDIO to 1.9V when VDDSDIO regulator is enabled as 1.8V mode.
  */
 void bootloader_common_vddsdio_configure();
+
+#ifdef __cplusplus
+}
+#endif
index bb3b2a81ddeae0219aa909af9a3d20c7034a902e..98a7712f33ce0025a6d934db379fdaca0d21a817 100644 (file)
 
 #include <stddef.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**
  * @brief Enable early entropy source for RNG
  *
@@ -47,3 +51,7 @@ void bootloader_random_disable(void);
  * @param length This many bytes of random data will be copied to buffer
  */
 void bootloader_fill_random(void *buffer, size_t length);
+
+#ifdef __cplusplus
+}
+#endif
index 500498d397e1287f96e734013f08baed3f61938a..a1b8d89c95af10ee7f89bb79c0a8013ac8cd6a16 100644 (file)
 
 #include <stddef.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**
  * @brief Check if half-open intervals overlap
  *
@@ -33,3 +37,7 @@ static inline bool bootloader_util_regions_overlap(
     assert(end2>start2);
     return (end1 > start2 && end2 > start1);
 }
+
+#ifdef __cplusplus
+}
+#endif
index 448f54a4ca75163878e9a1c27887c507162ae692..c0de5ca173f4a7e98e4d888fe8c0cc89bc3b0b4e 100644 (file)
@@ -11,8 +11,7 @@
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 // See the License for the specific language governing permissions and
 // limitations under the License.
-#ifndef __ESP32_FLASH_ENCRYPT_H
-#define __ESP32_FLASH_ENCRYPT_H
+#pragma once
 
 #include <stdbool.h>
 #include "esp_attr.h"
 #endif
 #include "soc/efuse_periph.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* @brief Flash encryption mode based on efuse values
 */
 typedef enum {
     ESP_FLASH_ENC_MODE_DISABLED,          // flash encryption is not enabled (flash crypt cnt=0)
     ESP_FLASH_ENC_MODE_DEVELOPMENT,       // flash encryption is enabled but for Development (reflash over UART allowed)
     ESP_FLASH_ENC_MODE_RELEASE            // flash encryption is enabled for Release (reflash over UART disabled)
-}esp_flash_enc_mode_t;
+} esp_flash_enc_mode_t;
 
 /**
  * @file esp_partition.h
@@ -118,7 +121,6 @@ esp_err_t esp_flash_encrypt_region(uint32_t src_addr, size_t data_length);
  * is enabled but secure boot is not used. This should protect against
  * serial re-flashing of an unauthorised code in absence of secure boot.
  *
- * @return 
  */
 void esp_flash_write_protect_crypt_cnt();
 
@@ -131,4 +133,6 @@ void esp_flash_write_protect_crypt_cnt();
  */
 esp_flash_enc_mode_t esp_get_flash_encryption_mode();
 
+#ifdef __cplusplus
+}
 #endif
index b66b66f5fd8e34341113b60e94051d2a3a3b6fcd..d0a9469d66834ccfebfbb041494b1cf4e7048435 100644 (file)
 #include "esp_flash_partitions.h"
 #include "esp_app_format.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #define ESP_ERR_IMAGE_BASE       0x2000
 #define ESP_ERR_IMAGE_FLASH_FAIL (ESP_ERR_IMAGE_BASE + 1)
 #define ESP_ERR_IMAGE_INVALID    (ESP_ERR_IMAGE_BASE + 2)
@@ -158,3 +162,7 @@ typedef struct {
     uint32_t irom_load_addr;
     uint32_t irom_size;
 } esp_image_flash_mapping_t;
+
+#ifdef __cplusplus
+}
+#endif
index 299c4959d21ecbeee869129b1c6fab6915a7cc39..2a7c22750b9b3b5de9058740b708171b9906453c 100644 (file)
@@ -131,7 +131,6 @@ typedef struct {
     uint8_t digest[64];
 } esp_secure_boot_iv_digest_t;
 
-
 #ifdef __cplusplus
 }
 #endif