2018-02-17 11:42:41 +07:00
|
|
|
/*
|
|
|
|
|
* This file is subject to the terms and conditions defined in
|
|
|
|
|
* file 'LICENSE', which is part of this source code package.
|
|
|
|
|
* Tuan PM <tuanpm at live dot com>
|
|
|
|
|
*/
|
2018-02-16 02:40:16 +07:00
|
|
|
#ifndef _ESP_PLATFORM_H__
|
|
|
|
|
#define _ESP_PLATFORM_H__
|
|
|
|
|
|
|
|
|
|
#include "freertos/FreeRTOS.h"
|
|
|
|
|
#include "freertos/task.h"
|
|
|
|
|
#include "freertos/semphr.h"
|
|
|
|
|
#include "freertos/queue.h"
|
2018-02-16 22:48:22 +07:00
|
|
|
#include "freertos/event_groups.h"
|
2018-02-16 02:40:16 +07:00
|
|
|
|
|
|
|
|
#include "lwip/err.h"
|
|
|
|
|
#include "lwip/sockets.h"
|
|
|
|
|
#include "lwip/sys.h"
|
|
|
|
|
#include "lwip/netdb.h"
|
|
|
|
|
#include "lwip/dns.h"
|
|
|
|
|
|
|
|
|
|
#include "rom/queue.h"
|
|
|
|
|
#include "esp_err.h"
|
|
|
|
|
#include "esp_log.h"
|
|
|
|
|
#include "esp_system.h"
|
|
|
|
|
|
|
|
|
|
char *platform_create_id_string();
|
|
|
|
|
int platform_random(int max);
|
2018-02-26 16:06:42 +08:00
|
|
|
long long platform_tick_get_ms();
|
2018-05-03 21:50:24 +07:00
|
|
|
void ms_to_timeval(int timeout_ms, struct timeval *tv);
|
|
|
|
|
|
|
|
|
|
#define ESP_MEM_CHECK(TAG, a, action) if (!(a)) { \
|
|
|
|
|
ESP_LOGE(TAG,"%s:%d (%s): %s", __FILE__, __LINE__, __FUNCTION__, "Memory exhausted"); \
|
|
|
|
|
action; \
|
|
|
|
|
}
|
2018-02-16 02:40:16 +07:00
|
|
|
#endif
|