diff --git a/hardware/tools/esp8266/sdk/include/c_types.h b/hardware/tools/esp8266/sdk/include/c_types.h index e6c450cdf..7bc0440de 100644 --- a/hardware/tools/esp8266/sdk/include/c_types.h +++ b/hardware/tools/esp8266/sdk/include/c_types.h @@ -66,6 +66,7 @@ typedef enum { #ifdef ICACHE_FLASH #define ICACHE_FLASH_ATTR __attribute__((section(".irom0.text"))) +#define ICACHE_RODATA_ATTR __attribute__((section(".irom.text"))) #else #define ICACHE_FLASH_ATTR #endif /* ICACHE_FLASH */ diff --git a/hardware/tools/esp8266/sdk/include/espconn.h b/hardware/tools/esp8266/sdk/include/espconn.h index deabfdce1..e95900791 100644 --- a/hardware/tools/esp8266/sdk/include/espconn.h +++ b/hardware/tools/esp8266/sdk/include/espconn.h @@ -87,6 +87,12 @@ struct espconn { void *reverse; }; +enum espconn_option{ + ESPCONN_REUSEADDR = 1, + ESPCONN_NODELAY, + ESPCONN_END +}; + /****************************************************************************** * FunctionName : espconn_connect * Description : The function given as the connect @@ -132,6 +138,43 @@ sint8 espconn_accept(struct espconn *espconn); sint8 espconn_create(struct espconn *espconn); +/****************************************************************************** + * FunctionName : espconn_tcp_get_max_con + * Description : get the number of simulatenously active TCP connections + * Parameters : none + * Returns : none +*******************************************************************************/ + +uint8 espconn_tcp_get_max_con(void); + +/****************************************************************************** + * FunctionName : espconn_tcp_set_max_con + * Description : set the number of simulatenously active TCP connections + * Parameters : num -- total number + * Returns : none +*******************************************************************************/ + +sint8 espconn_tcp_set_max_con(uint8 num); + +/****************************************************************************** + * FunctionName : espconn_tcp_get_max_con_allow + * Description : get the count of simulatenously active connections on the server + * Parameters : espconn -- espconn to get the count + * Returns : result +*******************************************************************************/ + +sint8 espconn_tcp_get_max_con_allow(struct espconn *espconn); + +/****************************************************************************** + * FunctionName : espconn_tcp_set_max_con_allow + * Description : set the count of simulatenously active connections on the server + * Parameters : espconn -- espconn to set the count + * num -- support the connection number + * Returns : result +*******************************************************************************/ + +sint8 espconn_tcp_set_max_con_allow(struct espconn *espconn, uint8 num); + /****************************************************************************** * FunctionName : espconn_regist_time * Description : used to specify the time that should be called when don't recv data @@ -228,6 +271,16 @@ sint8 espconn_regist_disconcb(struct espconn *espconn, espconn_connect_callback uint32 espconn_port(void); +/****************************************************************************** + * FunctionName : espconn_set_opt + * Description : access port value for client so that we don't end up bouncing + * all connections at the same time . + * Parameters : none + * Returns : access port value +*******************************************************************************/ + +sint8 espconn_set_opt(struct espconn *espconn, uint8 opt); + /****************************************************************************** * TypedefName : dns_found_callback * Description : Callback which is invoked when a hostname is found. @@ -317,5 +370,21 @@ sint8 espconn_igmp_join(ip_addr_t *host_ip, ip_addr_t *multicast_ip); *******************************************************************************/ sint8 espconn_igmp_leave(ip_addr_t *host_ip, ip_addr_t *multicast_ip); +/****************************************************************************** + * FunctionName : espconn_recv_hold + * Description : hold tcp receive + * Parameters : espconn -- espconn to hold + * Returns : none +*******************************************************************************/ +sint8 espconn_recv_hold(struct espconn *pespconn); + +/****************************************************************************** + * FunctionName : espconn_recv_unhold + * Description : unhold tcp receive + * Parameters : espconn -- espconn to unhold + * Returns : none +*******************************************************************************/ +sint8 espconn_recv_unhold(struct espconn *pespconn); + #endif diff --git a/hardware/tools/esp8266/sdk/include/ets_sys.h b/hardware/tools/esp8266/sdk/include/ets_sys.h index 5b4c62480..2244240af 100644 --- a/hardware/tools/esp8266/sdk/include/ets_sys.h +++ b/hardware/tools/esp8266/sdk/include/ets_sys.h @@ -36,6 +36,10 @@ typedef struct _ETSTIMER_ { } ETSTimer; /* interrupt related */ + +typedef void (*int_handler_t)(void*); + +#define ETS_SPI_INUM 2 #define ETS_GPIO_INUM 4 #define ETS_UART_INUM 5 #define ETS_UART1_INUM 5 @@ -48,13 +52,16 @@ typedef struct _ETSTIMER_ { ets_intr_unlock() #define ETS_FRC_TIMER1_INTR_ATTACH(func, arg) \ - ets_isr_attach(ETS_FRC_TIMER1_INUM, (void *)(func), (void *)(arg)) + ets_isr_attach(ETS_FRC_TIMER1_INUM, (int_handler_t)(func), (void *)(arg)) #define ETS_GPIO_INTR_ATTACH(func, arg) \ - ets_isr_attach(ETS_GPIO_INUM, (void *)(func), (void *)(arg)) + ets_isr_attach(ETS_GPIO_INUM, (int_handler_t)(func), (void *)(arg)) #define ETS_UART_INTR_ATTACH(func, arg) \ - ets_isr_attach(ETS_UART_INUM, (void *)(func), (void *)(arg)) + ets_isr_attach(ETS_UART_INUM, (int_handler_t)(func), (void *)(arg)) + +#define ETS_SPI_INTR_ATTACH(func, arg) \ + ets_isr_attach(ETS_SPI_INUM, (int_handler_t)(func), (void *)(arg)) #define ETS_INTR_ENABLE(inum) \ ets_isr_unmask((1<