core headers: Add C++ linker compatibility

This commit is contained in:
Angus Gratton 2015-10-05 18:33:32 +11:00
parent 65307aed75
commit afd58bc1ff
5 changed files with 39 additions and 2 deletions

View file

@ -13,10 +13,18 @@
#include <stdint.h>
#include <sys/types.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Return a random 32-bit number */
uint32_t hwrand(void);
/* Fill a variable size buffer with data from the Hardware RNG */
void hwrand_fill(uint8_t *buf, size_t len);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -11,6 +11,10 @@
#include "esp/types.h"
#include "esp/iomux_regs.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* Convert a GPIO pin number to an iomux register index.
*
@ -64,4 +68,8 @@ inline static void iomux_set_gpio_function(const uint8_t gpio_number, const uint
declared above */
#include "esp/iomux_private.h"
#ifdef __cplusplus
}
#endif
#endif

View file

@ -5,9 +5,12 @@
*/
#ifndef _ESP_ROM_H
#define _ESP_ROM_H
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
void Cache_Read_Disable(void);
/* http://esp8266-re.foogod.com/wiki/Cache_Read_Enable
@ -18,4 +21,8 @@ void Cache_Read_Disable(void);
*/
void Cache_Read_Enable(uint32_t odd_even, uint32_t mb_count, uint32_t no_idea);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -14,6 +14,10 @@
#include "esp/timer_regs.h"
#include "esp/cpu.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
FRC1 = 0,
FRC2 = 1,
@ -129,4 +133,8 @@ INLINED bool timer_set_timeout(const timer_frc_t frc, uint32_t us);
#include "timer_private.h"
#ifdef __cplusplus
}
#endif
#endif

View file

@ -7,6 +7,10 @@
#ifndef _ESP_TIMER_PRIVATE_H
#define _ESP_TIMER_PRIVATE_H
#ifdef __cplusplus
extern "C" {
#endif
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
@ -255,6 +259,8 @@ INLINED bool timer_set_timeout(const timer_frc_t frc, uint32_t us)
return _timer_set_timeout_runtime(frc, us);
}
#ifdef __cplusplus
}
#endif
#endif