mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-09-20 03:29:00 +08:00
Merge branch 'feature/clean_up' into 'master'
fix: Fixing lots of compilation warnings See merge request sdk/ESP8266_RTOS_SDK!173
This commit is contained in:
@ -23,6 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "esp_common.h"
|
#include "esp_common.h"
|
||||||
|
#include "freertos/portmacro.h"
|
||||||
|
|
||||||
#define US_TO_RTC_TIMER_TICKS(t) \
|
#define US_TO_RTC_TIMER_TICKS(t) \
|
||||||
((t) ? \
|
((t) ? \
|
||||||
|
@ -10,7 +10,9 @@
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
#include "c_types.h"
|
#include "c_types.h"
|
||||||
#include "esp8266/ets_sys.h"
|
#include "esp8266/ets_sys.h"
|
||||||
|
#include "esp_misc.h"
|
||||||
#include "gpio.h"
|
#include "gpio.h"
|
||||||
|
#include "freertos/portmacro.h"
|
||||||
|
|
||||||
#include "i2c_master.h"
|
#include "i2c_master.h"
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include "esp8266/ets_sys.h"
|
#include "esp8266/ets_sys.h"
|
||||||
#include "esp8266/pin_mux_register.h"
|
#include "esp8266/pin_mux_register.h"
|
||||||
#include "esp_libc.h"
|
#include "esp_libc.h"
|
||||||
|
#include "freertos/portmacro.h"
|
||||||
//*****************************************************************************
|
//*****************************************************************************
|
||||||
//
|
//
|
||||||
// Make sure all of the definitions in this header have a C binding.
|
// Make sure all of the definitions in this header have a C binding.
|
||||||
@ -457,7 +458,7 @@ int ICACHE_FLASH_ATTR SPIMasterRecvStatus(SpiNum spiNum)
|
|||||||
|
|
||||||
while (READ_PERI_REG(SPI_CMD(spiNum))&SPI_USR);
|
while (READ_PERI_REG(SPI_CMD(spiNum))&SPI_USR);
|
||||||
|
|
||||||
uint8_t data = (uint8)(READ_PERI_REG(SPI_W0(spiNum)) & 0xff);
|
(void)(READ_PERI_REG(SPI_W0(spiNum)) & 0xff);
|
||||||
SHOWREG();
|
SHOWREG();
|
||||||
|
|
||||||
return (uint8)(READ_PERI_REG(SPI_W0(spiNum)) & 0xff);
|
return (uint8)(READ_PERI_REG(SPI_W0(spiNum)) & 0xff);
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
#include "freertos/queue.h"
|
#include "freertos/queue.h"
|
||||||
|
|
||||||
#include "uart.h"
|
#include "uart.h"
|
||||||
|
#include "esp8266/rom_functions.h"
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
UART_EVENT_RX_CHAR,
|
UART_EVENT_RX_CHAR,
|
||||||
@ -82,6 +83,7 @@ uart0_write_char(char c)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
LOCAL void
|
LOCAL void
|
||||||
uart_rx_intr_handler_ssc(void *arg)
|
uart_rx_intr_handler_ssc(void *arg)
|
||||||
{
|
{
|
||||||
@ -109,7 +111,6 @@ uart_rx_intr_handler_ssc(void *arg)
|
|||||||
portEND_SWITCHING_ISR(xHigherPriorityTaskWoken);
|
portEND_SWITCHING_ISR(xHigherPriorityTaskWoken);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
LOCAL void
|
LOCAL void
|
||||||
uart_config(uint8 uart_no, UartDevice *uart)
|
uart_config(uint8 uart_no, UartDevice *uart)
|
||||||
{
|
{
|
||||||
@ -149,6 +150,7 @@ uart_config(uint8 uart_no, UartDevice *uart)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if 0
|
||||||
LOCAL void
|
LOCAL void
|
||||||
uart_task(void *pvParameters)
|
uart_task(void *pvParameters)
|
||||||
{
|
{
|
||||||
@ -170,7 +172,6 @@ uart_task(void *pvParameters)
|
|||||||
vTaskDelete(NULL);
|
vTaskDelete(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
void
|
void
|
||||||
uart_init(void)
|
uart_init(void)
|
||||||
{
|
{
|
||||||
@ -351,11 +352,9 @@ uart0_rx_intr_handler(void *para)
|
|||||||
/* uart0 and uart1 intr combine togther, when interrupt occur, see reg 0x3ff20020, bit2, bit0 represents
|
/* uart0 and uart1 intr combine togther, when interrupt occur, see reg 0x3ff20020, bit2, bit0 represents
|
||||||
* uart1 and uart0 respectively
|
* uart1 and uart0 respectively
|
||||||
*/
|
*/
|
||||||
uint8 RcvChar;
|
|
||||||
uint8 uart_no = UART0;//UartDev.buff_uart_no;
|
uint8 uart_no = UART0;//UartDev.buff_uart_no;
|
||||||
uint8 fifo_len = 0;
|
uint8 fifo_len = 0;
|
||||||
uint8 buf_idx = 0;
|
uint8 buf_idx = 0;
|
||||||
uint8 fifo_tmp[128] = {0};
|
|
||||||
|
|
||||||
uint32 uart_intr_status = READ_PERI_REG(UART_INT_ST(uart_no)) ;
|
uint32 uart_intr_status = READ_PERI_REG(UART_INT_ST(uart_no)) ;
|
||||||
|
|
||||||
|
@ -29,6 +29,10 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
#include "esp8266/gpio_register.h"
|
#include "esp8266/gpio_register.h"
|
||||||
|
|
||||||
|
#define ETS_GPIO_INTR_ENABLE() _xt_isr_unmask(1 << ETS_GPIO_INUM)
|
||||||
|
#define ETS_GPIO_INTR_DISABLE() _xt_isr_mask(1 << ETS_GPIO_INUM)
|
||||||
|
|
||||||
#define GPIO_Pin_0 (BIT(0)) /* Pin 0 selected */
|
#define GPIO_Pin_0 (BIT(0)) /* Pin 0 selected */
|
||||||
#define GPIO_Pin_1 (BIT(1)) /* Pin 1 selected */
|
#define GPIO_Pin_1 (BIT(1)) /* Pin 1 selected */
|
||||||
#define GPIO_Pin_2 (BIT(2)) /* Pin 2 selected */
|
#define GPIO_Pin_2 (BIT(2)) /* Pin 2 selected */
|
||||||
|
@ -29,16 +29,16 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define I2C_MASTER_SDA_HIGH_SCL_HIGH() \
|
#define I2C_MASTER_SDA_HIGH_SCL_HIGH() \
|
||||||
gpio_output_set(1<<I2C_MASTER_SDA_GPIO | 1<<I2C_MASTER_SCL_GPIO, 0, 1<<I2C_MASTER_SDA_GPIO | 1<<I2C_MASTER_SCL_GPIO, 0)
|
gpio_output_conf(1<<I2C_MASTER_SDA_GPIO | 1<<I2C_MASTER_SCL_GPIO, 0, 1<<I2C_MASTER_SDA_GPIO | 1<<I2C_MASTER_SCL_GPIO, 0)
|
||||||
|
|
||||||
#define I2C_MASTER_SDA_HIGH_SCL_LOW() \
|
#define I2C_MASTER_SDA_HIGH_SCL_LOW() \
|
||||||
gpio_output_set(1<<I2C_MASTER_SDA_GPIO, 1<<I2C_MASTER_SCL_GPIO, 1<<I2C_MASTER_SDA_GPIO | 1<<I2C_MASTER_SCL_GPIO, 0)
|
gpio_output_conf(1<<I2C_MASTER_SDA_GPIO, 1<<I2C_MASTER_SCL_GPIO, 1<<I2C_MASTER_SDA_GPIO | 1<<I2C_MASTER_SCL_GPIO, 0)
|
||||||
|
|
||||||
#define I2C_MASTER_SDA_LOW_SCL_HIGH() \
|
#define I2C_MASTER_SDA_LOW_SCL_HIGH() \
|
||||||
gpio_output_set(1<<I2C_MASTER_SCL_GPIO, 1<<I2C_MASTER_SDA_GPIO, 1<<I2C_MASTER_SDA_GPIO | 1<<I2C_MASTER_SCL_GPIO, 0)
|
gpio_output_conf(1<<I2C_MASTER_SCL_GPIO, 1<<I2C_MASTER_SDA_GPIO, 1<<I2C_MASTER_SDA_GPIO | 1<<I2C_MASTER_SCL_GPIO, 0)
|
||||||
|
|
||||||
#define I2C_MASTER_SDA_LOW_SCL_LOW() \
|
#define I2C_MASTER_SDA_LOW_SCL_LOW() \
|
||||||
gpio_output_set(0, 1<<I2C_MASTER_SDA_GPIO | 1<<I2C_MASTER_SCL_GPIO, 1<<I2C_MASTER_SDA_GPIO | 1<<I2C_MASTER_SCL_GPIO, 0)
|
gpio_output_conf(0, 1<<I2C_MASTER_SDA_GPIO | 1<<I2C_MASTER_SCL_GPIO, 1<<I2C_MASTER_SDA_GPIO | 1<<I2C_MASTER_SCL_GPIO, 0)
|
||||||
|
|
||||||
/** \defgroup Driver_APIs Driver APIs
|
/** \defgroup Driver_APIs Driver APIs
|
||||||
* @brief Driver APIs
|
* @brief Driver APIs
|
||||||
|
@ -126,8 +126,6 @@ typedef enum
|
|||||||
SpiPinCS_2 = 2,
|
SpiPinCS_2 = 2,
|
||||||
} SpiPinCS;
|
} SpiPinCS;
|
||||||
|
|
||||||
#pragma pack (1)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief SPI attribute
|
* @brief SPI attribute
|
||||||
*/
|
*/
|
||||||
@ -152,8 +150,6 @@ typedef struct
|
|||||||
uint8_t dataLen; ///< Data byte length.
|
uint8_t dataLen; ///< Data byte length.
|
||||||
} SpiData;
|
} SpiData;
|
||||||
|
|
||||||
#pragma upack (1)
|
|
||||||
|
|
||||||
#define SHOWREG() __ShowRegValue(__func__, __LINE__);
|
#define SHOWREG() __ShowRegValue(__func__, __LINE__);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
17
components/esp8266/include/esp8266/rom_functions.h
Normal file
17
components/esp8266/include/esp8266/rom_functions.h
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
#ifndef _ROM_FUNCTIONS_H
|
||||||
|
#define _ROM_FUNCTIONS_H
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
uint32_t Wait_SPI_Idle();
|
||||||
|
|
||||||
|
void uart_div_modify(uint32_t uart_no, uint32_t baud_div);
|
||||||
|
|
||||||
|
void ets_delay_us(uint32_t us);
|
||||||
|
int ets_printf(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
|
||||||
|
|
||||||
|
void system_soft_wdt_feed();
|
||||||
|
|
||||||
|
void Cache_Read_Enable_New();
|
||||||
|
|
||||||
|
#endif
|
@ -42,7 +42,7 @@ static void *task_create_wrapper(void *task_func, const char *name, uint32_t sta
|
|||||||
portBASE_TYPE ret;
|
portBASE_TYPE ret;
|
||||||
xTaskHandle handle;
|
xTaskHandle handle;
|
||||||
|
|
||||||
ret = xTaskCreate(task_func, (const signed char *)name, stack_depth, param, prio, &handle);
|
ret = xTaskCreate(task_func, name, stack_depth, param, prio, &handle);
|
||||||
|
|
||||||
return ret == pdPASS ? handle : NULL;
|
return ret == pdPASS ? handle : NULL;
|
||||||
}
|
}
|
||||||
@ -248,7 +248,7 @@ static uint32_t get_free_heap_size_wrapper(void)
|
|||||||
|
|
||||||
static void *timer_create_wrapper(const char *name, uint32_t period_ticks, bool auto_load, void *arg, void (*cb)(void *timer))
|
static void *timer_create_wrapper(const char *name, uint32_t period_ticks, bool auto_load, void *arg, void (*cb)(void *timer))
|
||||||
{
|
{
|
||||||
return xTimerCreate((const signed char *)name, period_ticks, auto_load, arg, (tmrTIMER_CALLBACK)cb);
|
return xTimerCreate(name, period_ticks, auto_load, arg, (tmrTIMER_CALLBACK)cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *timer_get_arg_wrapper(void *timer)
|
static void *timer_get_arg_wrapper(void *timer)
|
||||||
|
@ -116,12 +116,11 @@ task.h is included from an application file. */
|
|||||||
#include "freertos/task.h"
|
#include "freertos/task.h"
|
||||||
|
|
||||||
#include "esp8266/ets_sys.h"
|
#include "esp8266/ets_sys.h"
|
||||||
|
#include "esp8266/rom_functions.h"
|
||||||
|
|
||||||
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
|
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
|
||||||
|
|
||||||
#define mtCOVERAGE_TEST_MARKER()
|
#define mtCOVERAGE_TEST_MARKER()
|
||||||
#define traceFREE(...)
|
|
||||||
#define traceMALLOC(...)
|
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
#define mem_printf(fmt, args...) ets_printf(fmt,## args)
|
#define mem_printf(fmt, args...) ets_printf(fmt,## args)
|
||||||
@ -253,7 +252,7 @@ void pvShowMalloc()
|
|||||||
const char *file_name_printf;
|
const char *file_name_printf;
|
||||||
//ets_printf("sh2,");
|
//ets_printf("sh2,");
|
||||||
file_name_printf = vGetFileName(file_name, pxIterator->pxNextFreeBlock->file);
|
file_name_printf = vGetFileName(file_name, pxIterator->pxNextFreeBlock->file);
|
||||||
os_printf("F:%s\tL:%u\tmalloc %d\t@ %x\n", file_name_printf, pxIterator->pxNextFreeBlock->line, pxIterator->pxNextFreeBlock->xBlockSize - 0x80000000, ( void * ) ( ( ( unsigned char * ) pxIterator->pxNextFreeBlock ) + uxHeapStructSize));
|
os_printf("F:%s\tL:%u\tmalloc %d\t@ %p\n", file_name_printf, pxIterator->pxNextFreeBlock->line, pxIterator->pxNextFreeBlock->xBlockSize - 0x80000000, ( void * ) ( ( ( unsigned char * ) pxIterator->pxNextFreeBlock ) + uxHeapStructSize));
|
||||||
//ets_printf("sh3,");
|
//ets_printf("sh3,");
|
||||||
// ets_delay_us(2000);
|
// ets_delay_us(2000);
|
||||||
system_soft_wdt_feed();
|
system_soft_wdt_feed();
|
||||||
@ -531,7 +530,7 @@ BlockLink_t *pxLink;
|
|||||||
ETS_INTR_LOCK();
|
ETS_INTR_LOCK();
|
||||||
#ifdef MEMLEAK_DEBUG
|
#ifdef MEMLEAK_DEBUG
|
||||||
if(prvRemoveBlockFromUsedList(pxLink) < 0){
|
if(prvRemoveBlockFromUsedList(pxLink) < 0){
|
||||||
ets_printf("%x already freed\n", pv);
|
ets_printf("%p already freed\n", pv);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
@ -865,4 +864,3 @@ const HeapRegion_t *pxHeapRegion;
|
|||||||
yFreeBytesRemaining = 0;
|
yFreeBytesRemaining = 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,8 +78,10 @@ Called after minimal context has been saved, with interrupts disabled.
|
|||||||
RTOS port can call0 _xt_context_save to save the rest of the context.
|
RTOS port can call0 _xt_context_save to save the rest of the context.
|
||||||
May only be called from assembly code by the 'call0' instruction.
|
May only be called from assembly code by the 'call0' instruction.
|
||||||
*/
|
*/
|
||||||
// void XT_RTOS_INT_ENTER(void)
|
|
||||||
#define XT_RTOS_INT_ENTER _xt_int_enter
|
#define XT_RTOS_INT_ENTER _xt_int_enter
|
||||||
|
#ifndef __ASSEMBLER__
|
||||||
|
void XT_RTOS_INT_ENTER();
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Inform RTOS of completion of an interrupt handler, and give control to
|
Inform RTOS of completion of an interrupt handler, and give control to
|
||||||
@ -91,8 +93,10 @@ leaving only a minimal part of the context to be restored by the exit
|
|||||||
dispatcher. This function does not return to the place it was called from.
|
dispatcher. This function does not return to the place it was called from.
|
||||||
May only be called from assembly code by the 'call0' instruction.
|
May only be called from assembly code by the 'call0' instruction.
|
||||||
*/
|
*/
|
||||||
// void XT_RTOS_INT_EXIT(void)
|
|
||||||
#define XT_RTOS_INT_EXIT _xt_int_exit
|
#define XT_RTOS_INT_EXIT _xt_int_exit
|
||||||
|
#ifndef __ASSEMBLER__
|
||||||
|
void XT_RTOS_INT_EXIT();
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Inform RTOS of the occurrence of a tick timer interrupt.
|
Inform RTOS of the occurrence of a tick timer interrupt.
|
||||||
@ -100,8 +104,10 @@ If RTOS has no tick timer, leave XT_RTOS_TIMER_INT undefined.
|
|||||||
May be coded in or called from C or assembly, per ABI conventions.
|
May be coded in or called from C or assembly, per ABI conventions.
|
||||||
RTOS may optionally define XT_TICK_PER_SEC in its own way (eg. macro).
|
RTOS may optionally define XT_TICK_PER_SEC in its own way (eg. macro).
|
||||||
*/
|
*/
|
||||||
// void XT_RTOS_TIMER_INT(void)
|
|
||||||
#define XT_RTOS_TIMER_INT _xt_timer_int
|
#define XT_RTOS_TIMER_INT _xt_timer_int
|
||||||
|
#ifndef __ASSEMBLER__
|
||||||
|
void XT_RTOS_TIMER_INT();
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Return in a15 the base address of the co-processor state save area for the
|
Return in a15 the base address of the co-processor state save area for the
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#include "esp8266/ets_sys.h"
|
#include "esp8266/ets_sys.h"
|
||||||
#include "esp8266/eagle_soc.h"
|
#include "esp8266/eagle_soc.h"
|
||||||
#include "esp8266/uart_register.h"
|
#include "esp8266/uart_register.h"
|
||||||
|
#include "freertos/portmacro.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Todo: panic output UART ID, we may add it to 'kconfig' to select target UART.
|
* Todo: panic output UART ID, we may add it to 'kconfig' to select target UART.
|
||||||
|
@ -75,21 +75,26 @@
|
|||||||
#include "freertos/task.h"
|
#include "freertos/task.h"
|
||||||
#include "freertos/queue.h"
|
#include "freertos/queue.h"
|
||||||
#include "freertos/xtensa_rtos.h"
|
#include "freertos/xtensa_rtos.h"
|
||||||
|
#include "esp8266/rom_functions.h"
|
||||||
|
|
||||||
#define PORT_ASSERT(x) do { if (!(x)) {ets_printf("%s %u\n", "rtos_port", __LINE__); while(1){}; }} while (0)
|
#define PORT_ASSERT(x) do { if (!(x)) {ets_printf("%s %u\n", "rtos_port", __LINE__); while(1){}; }} while (0)
|
||||||
|
|
||||||
extern char NMIIrqIsOn;
|
extern char NMIIrqIsOn;
|
||||||
static char HdlMacSig = 0;
|
static uint8_t HdlMacSig = 0;
|
||||||
static char SWReq = 0;
|
static uint8_t SWReq = 0;
|
||||||
|
|
||||||
unsigned cpu_sr;
|
unsigned cpu_sr;
|
||||||
|
|
||||||
/* Each task maintains its own interrupt status in the critical nesting
|
/* Each task maintains its own interrupt status in the critical nesting
|
||||||
variable. */
|
variable. */
|
||||||
static unsigned portBASE_TYPE uxCriticalNesting = 0;
|
static uint32_t uxCriticalNesting = 0;
|
||||||
|
|
||||||
void vPortEnterCritical(void);
|
void vPortEnterCritical(void);
|
||||||
void vPortExitCritical(void);
|
void vPortExitCritical(void);
|
||||||
|
|
||||||
|
void _xt_timer_int1(void);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* See header file for description.
|
* See header file for description.
|
||||||
*/
|
*/
|
||||||
@ -237,7 +242,7 @@ void IRAM_ATTR vPortExitCritical(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ets_printf("E:C:%d\n", uxCriticalNesting);
|
ets_printf("E:C:%u\n", uxCriticalNesting);
|
||||||
PORT_ASSERT((uxCriticalNesting > 0));
|
PORT_ASSERT((uxCriticalNesting > 0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -245,9 +250,9 @@ void IRAM_ATTR vPortExitCritical(void)
|
|||||||
|
|
||||||
void ShowCritical(void)
|
void ShowCritical(void)
|
||||||
{
|
{
|
||||||
os_printf("ShowCritical:%d\n", uxCriticalNesting);
|
os_printf("ShowCritical:%u\n", uxCriticalNesting);
|
||||||
os_printf("HdlMacSig:%d\n", HdlMacSig);
|
os_printf("HdlMacSig:%u\n", HdlMacSig);
|
||||||
os_printf("SWReq:%d\n", SWReq);
|
os_printf("SWReq:%u\n", SWReq);
|
||||||
|
|
||||||
ets_delay_us(50000);
|
ets_delay_us(50000);
|
||||||
}
|
}
|
||||||
|
@ -18,3 +18,5 @@ COMPONENT_SRCDIRS += apps/dhcpserver \
|
|||||||
port/esp8266/netif
|
port/esp8266/netif
|
||||||
|
|
||||||
CFLAGS += -Wno-address #lots of LWIP source files evaluate macros that check address of stack variables
|
CFLAGS += -Wno-address #lots of LWIP source files evaluate macros that check address of stack variables
|
||||||
|
|
||||||
|
lwip/src/apps/sntp/sntp.o: CFLAGS += -Wno-implicit-function-declaration
|
@ -68,7 +68,7 @@ void TimerCountdown(Timer* timer, unsigned int timeout)
|
|||||||
int TimerLeftMS(Timer* timer)
|
int TimerLeftMS(Timer* timer)
|
||||||
{
|
{
|
||||||
xTaskCheckForTimeOut(&timer->xTimeOut, &timer->xTicksToWait); /* updates xTicksToWait to the number left */
|
xTaskCheckForTimeOut(&timer->xTimeOut, &timer->xTicksToWait); /* updates xTicksToWait to the number left */
|
||||||
return (timer->xTicksToWait < 0) ? 0 : (timer->xTicksToWait * portTICK_RATE_MS);
|
return timer->xTicksToWait * portTICK_RATE_MS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -90,7 +90,6 @@ static int esp_read(Network* n, unsigned char* buffer, unsigned int len, unsigne
|
|||||||
portTickType xTicksToWait = timeout_ms / portTICK_RATE_MS; /* convert milliseconds to ticks */
|
portTickType xTicksToWait = timeout_ms / portTICK_RATE_MS; /* convert milliseconds to ticks */
|
||||||
xTimeOutType xTimeOut;
|
xTimeOutType xTimeOut;
|
||||||
int recvLen = 0;
|
int recvLen = 0;
|
||||||
int recv_timeout = timeout_ms;
|
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
|
||||||
struct timeval timeout;
|
struct timeval timeout;
|
||||||
@ -128,7 +127,6 @@ static int esp_write(Network* n, unsigned char* buffer, unsigned int len, unsign
|
|||||||
portTickType xTicksToWait = timeout_ms / portTICK_RATE_MS; /* convert milliseconds to ticks */
|
portTickType xTicksToWait = timeout_ms / portTICK_RATE_MS; /* convert milliseconds to ticks */
|
||||||
xTimeOutType xTimeOut;
|
xTimeOutType xTimeOut;
|
||||||
int sentLen = 0;
|
int sentLen = 0;
|
||||||
int send_timeout = timeout_ms;
|
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
int readysock;
|
int readysock;
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ void *_calloc_r(struct _reent *r, size_t c, size_t s)
|
|||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *_free_r(struct _reent *r, void *ptr)
|
void _free_r(struct _reent *r, void *ptr)
|
||||||
{
|
{
|
||||||
vPortFree(ptr);
|
vPortFree(ptr);
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,8 @@
|
|||||||
#include "esp_system.h"
|
#include "esp_system.h"
|
||||||
#include "esp_timer.h"
|
#include "esp_timer.h"
|
||||||
|
|
||||||
|
#include "FreeRTOS.h"
|
||||||
|
|
||||||
static uint64_t s_boot_time;
|
static uint64_t s_boot_time;
|
||||||
|
|
||||||
static os_timer_t microsecond_overflow_timer;
|
static os_timer_t microsecond_overflow_timer;
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#include "esp_libc.h"
|
||||||
|
|
||||||
#if defined(MBEDTLS_ENTROPY_HARDWARE_ALT)
|
#if defined(MBEDTLS_ENTROPY_HARDWARE_ALT)
|
||||||
/**
|
/**
|
||||||
@ -34,6 +35,6 @@ int mbedtls_hardware_poll( void *data,
|
|||||||
{
|
{
|
||||||
os_get_random(output, len);
|
os_get_random(output, len);
|
||||||
*olen = len;
|
*olen = len;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -128,7 +128,10 @@ int mbedtls_net_connect( mbedtls_net_context *ctx, const char *host, const char
|
|||||||
*/
|
*/
|
||||||
int mbedtls_net_bind( mbedtls_net_context *ctx, const char *bind_ip, const char *port, int proto )
|
int mbedtls_net_bind( mbedtls_net_context *ctx, const char *bind_ip, const char *port, int proto )
|
||||||
{
|
{
|
||||||
int n, ret;
|
#if SO_REUSE
|
||||||
|
int n;
|
||||||
|
#endif
|
||||||
|
int ret;
|
||||||
struct addrinfo hints, *addr_list, *cur;
|
struct addrinfo hints, *addr_list, *cur;
|
||||||
|
|
||||||
if( ( ret = net_prepare() ) != 0 )
|
if( ( ret = net_prepare() ) != 0 )
|
||||||
|
@ -173,10 +173,10 @@ int base64_encode(uint8* dst, size_t dlen, size_t* olen,
|
|||||||
|
|
||||||
*olen = p - dst;
|
*olen = p - dst;
|
||||||
*p = 0;
|
*p = 0;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Return server SSLv23 method.
|
Return server SSLv23 method.
|
||||||
@ -214,7 +214,7 @@ int SSL_CTX_load_verify_locations(SSL_CTX* ctx, const char* CAfile,
|
|||||||
const char* CApath)
|
const char* CApath)
|
||||||
{
|
{
|
||||||
X509* cacrt = NULL;
|
X509* cacrt = NULL;
|
||||||
cacrt = d2i_X509(NULL, CAfile, strlen(CAfile));
|
cacrt = d2i_X509(NULL, (const unsigned char *)CAfile, strlen(CAfile));
|
||||||
|
|
||||||
if (cacrt) {
|
if (cacrt) {
|
||||||
SSL_CTX_add_client_CA(ctx, cacrt);
|
SSL_CTX_add_client_CA(ctx, cacrt);
|
||||||
@ -343,7 +343,7 @@ If buf is NULL , the error string is placed in a static buffer.
|
|||||||
*/
|
*/
|
||||||
char* ERR_error_string(unsigned long e, char* ret)
|
char* ERR_error_string(unsigned long e, char* ret)
|
||||||
{
|
{
|
||||||
return;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user