2 * Taken from https://github.com/Spritetm/libesphttpd/tree/master/include/
4 * Potentially originally from Martin Harizanov (http://harizanov.com/)
5 * and the ESP8266 community.
7 #ifndef ESPMISSINGINCLUDES_H
8 #define ESPMISSINGINCLUDES_H
13 int strcasecmp(const char *a, const char *b);
15 #include <eagle_soc.h>
17 // Missing function prototypes in include folders. GCC will warn on these if
18 // we don't define 'em anywhere.
19 // MOST OF THESE ARE GUESSED! but they seem to work and shut up the compiler.
20 typedef struct espconn espconn;
22 int atoi(const char *nptr);
23 void ets_install_putc1(void *routine);
24 void ets_isr_attach(int intr, void *handler, void *arg);
25 void ets_isr_mask(unsigned intr);
26 void ets_isr_unmask(unsigned intr);
27 int ets_memcmp(const void *s1, const void *s2, size_t n);
28 void *ets_memcpy(void *dest, const void *src, size_t n);
29 void *ets_memset(void *s, int c, size_t n);
30 int ets_sprintf(char *str, const char *format, ...)
31 __attribute__ ((format (printf, 2, 3)));
32 int ets_str2macaddr(void *, void *);
33 int ets_strcmp(const char *s1, const char *s2);
34 char *ets_strcpy(char *dest, const char *src);
35 size_t ets_strlen(const char *s);
36 int ets_strncmp(const char *s1, const char *s2, int len);
37 char *ets_strncpy(char *dest, const char *src, size_t n);
38 char *ets_strstr(const char *haystack, const char *needle);
39 void ets_timer_arm_new(os_timer_t *a, int b, int c, int isMstimer);
40 void ets_timer_disarm(os_timer_t *a);
41 void ets_timer_setfn(os_timer_t *t, ETSTimerFunc *fn, void *parg);
42 void ets_update_cpu_frequency(int freqmhz);
43 void *os_memmove(void *dest, const void *src, size_t n);
44 int os_printf(const char *format, ...)
45 __attribute__ ((format (printf, 1, 2)));
46 int os_snprintf(char *str, size_t size, const char *format, ...)
47 __attribute__ ((format (printf, 3, 4)));
48 int os_printf_plus(const char *format, ...)
49 __attribute__ ((format (printf, 1, 2)));
50 void uart_div_modify(int no, unsigned int freq);
51 uint8 wifi_get_opmode(void);
52 uint32 system_get_time();
54 void ets_bzero(void *s, size_t n);
55 void ets_delay_us(int ms);
57 // Hack: this is defined in SDK 1.4.0 and undefined in 1.3.0. It's only used
58 // for this, the symbol itself has no meaning here.
59 #ifndef RC_LIMIT_P2P_11N
60 // Defs for SDK <1.4.0
61 void *pvPortMalloc(size_t xWantedSize);
62 void *pvPortZalloc(size_t);
63 void vPortFree(void *ptr);
64 void *vPortMalloc(size_t xWantedSize);
65 void pvPortFree(void *ptr);
67 void *pvPortMalloc(size_t xWantedSize, const char *file, int line);
68 void *pvPortZalloc(size_t, const char *file, int line);
69 void vPortFree(void *ptr, const char *file, int line);
70 void *vPortMalloc(size_t xWantedSize, const char *file, int line);
71 void pvPortFree(void *ptr, const char *file, int line);
74 // Standard PIN_FUNC_SELECT gives a warning. Replace by a non-warning one.
75 #ifdef PIN_FUNC_SELECT
76 #undef PIN_FUNC_SELECT
77 #define PIN_FUNC_SELECT(PIN_NAME, FUNC) do { \
78 WRITE_PERI_REG(PIN_NAME, \
79 (READ_PERI_REG(PIN_NAME) \
80 & (~(PERIPHS_IO_MUX_FUNC<<PERIPHS_IO_MUX_FUNC_S))) \
81 |( (((FUNC&BIT2)<<2)|(FUNC&0x3))<<PERIPHS_IO_MUX_FUNC_S) ); \
83 #endif /* PIN_FUNC_SELECT */
87 #endif /* ESPMISSINGINCLUDES_H */