Skip to content

Extern C blocks (#1352) #4044

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions cores/esp8266/pgmspace.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
#include <stdint.h>
#include <stdio.h>

#ifdef __cplusplus
extern "C" {
#endif

#ifdef __ets__

Expand All @@ -26,6 +23,10 @@ extern "C" {
#endif // __ets__


#ifdef __cplusplus
extern "C" {
#endif

#define _SFR_BYTE(n) (n)

typedef void prog_void;
Expand Down
12 changes: 6 additions & 6 deletions cores/esp8266/umm_malloc/umm_malloc_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
#define _UMM_MALLOC_CFG_H

#include <debug.h>
#ifdef __cplusplus
extern "C" {
#endif
//#ifdef __cplusplus
//extern "C" {
//#endif
#include "c_types.h"
#ifdef __cplusplus
}
#endif
//#ifdef __cplusplus
//}
//#endif
/*
* There are a number of defines you can set at compile time that affect how
* the memory allocator will operate.
Expand Down
4 changes: 2 additions & 2 deletions libraries/GDBStub/src/internal/gdbstub-entry.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ int gdbstub_del_hw_watchpoint(int addr);
extern void* gdbstub_do_break_breakpoint_addr;

#ifdef __cplusplus
{
}
#endif

#endif
#endif
8 changes: 8 additions & 0 deletions tools/sdk/include/at_custom.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@

#include "c_types.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef struct
{
char *at_cmdName;
Expand Down Expand Up @@ -169,4 +173,8 @@ bool at_fake_uart_enable(bool enable,at_fake_uart_tx_func_type at_fake_uart_tx_f
*/
bool at_set_escape_character(uint8 ch);

#ifdef __cplusplus
}
#endif

#endif
12 changes: 12 additions & 0 deletions tools/sdk/include/espconn.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
#ifndef __ESPCONN_H__
#define __ESPCONN_H__

#ifdef __cplusplus
extern "C" {
#endif

typedef sint8 err_t;

typedef void *espconn_handle;
Expand Down Expand Up @@ -742,5 +746,13 @@ void espconn_dns_setserver(uint8 numdns, ip_addr_t *dnsserver);
* Returns : dnsserver -- IP address of the DNS server to set
*******************************************************************************/
ip_addr_t espconn_dns_getserver(uint8 numdns);


#ifdef __cplusplus
}
#endif

#endif



9 changes: 9 additions & 0 deletions tools/sdk/include/espnow.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
#ifndef __ESPNOW_H__
#define __ESPNOW_H__


#ifdef __cplusplus
extern "C" {
#endif

enum esp_now_role {
ESP_NOW_ROLE_IDLE = 0,
ESP_NOW_ROLE_CONTROLLER,
Expand Down Expand Up @@ -70,4 +75,8 @@ int esp_now_get_cnt_info(u8 *all_cnt, u8 *encrypt_cnt);

int esp_now_set_kok(u8 *key, u8 len);

#ifdef __cplusplus
}
#endif

#endif
8 changes: 8 additions & 0 deletions tools/sdk/include/ets_sys.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
#include "eagle_soc.h"
#include <stddef.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef uint32_t ETSSignal;
typedef uint32_t ETSParam;

Expand Down Expand Up @@ -213,4 +217,8 @@ bool ets_task(ETSTask task, uint8 prio, ETSEvent *queue, uint8 qlen);
bool ets_post(uint8 prio, ETSSignal sig, ETSParam par);


#ifdef __cplusplus
}
#endif

#endif /* _ETS_SYS_H */
8 changes: 8 additions & 0 deletions tools/sdk/include/gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
#ifndef _GPIO_H_
#define _GPIO_H_

#ifdef __cplusplus
extern "C" {
#endif

#define GPIO_PIN_ADDR(i) (GPIO_PIN0_ADDRESS + i*4)

#define GPIO_ID_IS_PIN_REGISTER(reg_id) \
Expand Down Expand Up @@ -116,4 +120,8 @@ void gpio_pin_wakeup_disable();

void gpio_pin_intr_state_set(uint32 i, GPIO_INT_TYPE intr_state);

#ifdef __cplusplus
}
#endif

#endif // _GPIO_H_
9 changes: 9 additions & 0 deletions tools/sdk/include/ip_addr.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@

#include "c_types.h"

#ifdef __cplusplus
extern "C" {
#endif

struct ip_addr {
uint32 addr;
};
Expand Down Expand Up @@ -84,4 +88,9 @@ uint32 ipaddr_addr(const char *cp);

#define IPSTR "%d.%d.%d.%d"


#ifdef __cplusplus
}
#endif

#endif /* __IP_ADDR_H__ */
9 changes: 9 additions & 0 deletions tools/sdk/include/mem.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
#ifndef __MEM_H__
#define __MEM_H__

#ifdef __cplusplus
extern "C" {
#endif

/* Note: check_memleak_debug_enable is a weak function inside SDK.
* please copy following codes to user_main.c.
#include "mem.h"
Expand Down Expand Up @@ -77,5 +81,10 @@ do{\

#endif


#ifdef __cplusplus
}
#endif

#endif

1 change: 1 addition & 0 deletions tools/sdk/include/mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "ip_addr.h"
#include "user_interface.h"
#include "espconn.h"

#ifdef __cplusplus
extern "C" {
#endif
Expand Down
9 changes: 9 additions & 0 deletions tools/sdk/include/osapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
#include <string.h>
#include "user_config.h"

#ifdef __cplusplus
extern "C" {
#endif

#define os_bzero ets_bzero
#define os_delay_us ets_delay_us
#define os_install_putc1 ets_install_putc1
Expand Down Expand Up @@ -77,5 +81,10 @@ extern int os_printf_plus(const char * format, ...) __attribute__ ((format (prin
unsigned long os_random(void);
int os_get_random(unsigned char *buf, size_t len);


#ifdef __cplusplus
}
#endif

#endif

7 changes: 7 additions & 0 deletions tools/sdk/include/ping.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
#ifndef __PING_H__
#define __PING_H__

#ifdef __cplusplus
extern "C" {
#endif

typedef void (* ping_recv_function)(void* arg, void *pdata);
typedef void (* ping_sent_function)(void* arg, void *pdata);
Expand Down Expand Up @@ -53,4 +56,8 @@ bool ping_start(struct ping_option *ping_opt);
bool ping_regist_recv(struct ping_option *ping_opt, ping_recv_function ping_recv);
bool ping_regist_sent(struct ping_option *ping_opt, ping_sent_function ping_sent);

#ifdef __cplusplus
}
#endif

#endif /* __PING_H__ */
9 changes: 9 additions & 0 deletions tools/sdk/include/pwm.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
#ifndef __PWM_H__
#define __PWM_H__

#ifdef __cplusplus
extern "C" {
#endif

/*pwm.h: function and macro definition of PWM API , driver level */
/*user_light.h: user interface for light API, user level*/
/*user_light_adj: API for color changing and lighting effects, user level*/
Expand Down Expand Up @@ -54,5 +58,10 @@ uint32 pwm_get_period(void);
uint32 get_pwm_version(void);
void set_pwm_debug_en(uint8 print_en);


#ifdef __cplusplus
}
#endif

#endif

8 changes: 8 additions & 0 deletions tools/sdk/include/simple_pair.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
#ifndef __SIMPLE_PAIR_H__
#define __SIMPLE_PAIR_H__

#ifdef __cplusplus
extern "C" {
#endif

typedef enum {
SP_ST_STA_FINISH = 0,
SP_ST_AP_FINISH = 0,
Expand Down Expand Up @@ -61,4 +65,8 @@ int simple_pair_set_peer_ref(u8 *peer_mac, u8 *tmp_key, u8 *ex_key);
int simple_pair_get_peer_ref(u8 *peer_mac, u8 *tmp_key, u8 *ex_key);


#ifdef __cplusplus
}
#endif

#endif /* __SIMPLE_PAIR_H__ */
9 changes: 9 additions & 0 deletions tools/sdk/include/smartconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
#ifndef __SMARTCONFIG_H__
#define __SMARTCONFIG_H__

#ifdef __cplusplus
extern "C" {
#endif

typedef enum {
SC_STATUS_WAIT = 0,
SC_STATUS_FIND_CHANNEL,
Expand All @@ -47,4 +51,9 @@ bool smartconfig_stop(void);
bool esptouch_set_timeout(uint8 time_s); //15s~255s, offset:45s
bool smartconfig_set_type(sc_type type);


#ifdef __cplusplus
}
#endif

#endif
10 changes: 10 additions & 0 deletions tools/sdk/include/sntp.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
#else
#include "ip_addr.h"
#endif

#ifdef __cplusplus
extern "C" {
#endif

/**
* get the seconds since Jan 01, 1970, 00:00 (GMT + 8)
*/
Expand Down Expand Up @@ -65,4 +70,9 @@ char *sntp_getservername(unsigned char idx);

#define sntp_servermode_dhcp(x)


#ifdef __cplusplus
}
#endif

#endif
9 changes: 9 additions & 0 deletions tools/sdk/include/spi_flash.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
#ifndef SPI_FLASH_H
#define SPI_FLASH_H

#ifdef __cplusplus
extern "C" {
#endif

typedef enum {
SPI_FLASH_RESULT_OK,
SPI_FLASH_RESULT_ERR,
Expand Down Expand Up @@ -60,4 +64,9 @@ void spi_flash_set_read_func(user_spi_flash_read read);
bool spi_flash_erase_protect_enable(void);
bool spi_flash_erase_protect_disable(void);


#ifdef __cplusplus
}
#endif

#endif
11 changes: 11 additions & 0 deletions tools/sdk/include/upgrade.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
#ifndef __UPGRADE_H__
#define __UPGRADE_H__

#ifdef __cplusplus
extern "C" {
#endif


#define SPI_FLASH_SEC_SIZE 4096
#define LIMIT_ERASE_SIZE 0x10000

Expand Down Expand Up @@ -71,4 +76,10 @@ bool system_upgrade_start_ssl(struct upgrade_server_info *server); // not suppor
#else
bool system_upgrade_start(struct upgrade_server_info *server);
#endif


#ifdef __cplusplus
}
#endif

#endif
9 changes: 9 additions & 0 deletions tools/sdk/include/user_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
#include "spi_flash.h"
#include "gpio.h"

#ifdef __cplusplus
extern "C" {
#endif

#ifndef MAC2STR
#define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
#define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x"
Expand Down Expand Up @@ -651,4 +655,9 @@ void wifi_disable_gpio_wakeup(void);

void uart_div_modify(uint8 uart_no, uint32 DivLatchValue);

#ifdef __cplusplus
}
#endif


#endif
Loading