Toggle navigation
Documentation
The friendly Operating System for the Internet of Things
Loading...
Searching...
No Matches
esp_common.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2019 Gunar Schorcht
3
*
4
* This file is subject to the terms and conditions of the GNU Lesser
5
* General Public License v2.1. See the file LICENSE in the top level
6
* directory for more details.
7
*/
8
20
#ifndef ESP_COMMON_H
21
#define ESP_COMMON_H
22
23
#ifndef DOXYGEN
24
25
#ifdef __cplusplus
26
extern
"C"
{
27
#endif
28
29
#include "log.h"
30
#include "
esp_common_log.h
"
31
#include "
macros/utils.h
"
32
#include "
macros/xtstr.h
"
33
34
#if !defined(ICACHE_FLASH)
35
#ifndef ICACHE_RAM_ATTR
37
#define ICACHE_RAM_ATTR __attribute__((section(".iram0.text")))
38
#endif
39
#else
/* ICACHE_FLASH */
40
#ifndef ICACHE_RAM_ATTR
41
#define ICACHE_RAM_ATTR
42
#endif
43
#endif
/* ICACHE_FLASH */
44
45
#ifndef RTC_BSS_ATTR
46
#define RTC_BSS_ATTR __attribute__((section(".rtc.bss")))
47
#endif
48
49
#ifdef CPU_ESP8266
50
#ifndef RTC_DATA_ATTR
51
#define RTC_DATA_ATTR __attribute__((section(".rtc.data")))
52
#endif
53
#endif
54
56
#define NOT_YET_IMPLEMENTED() LOG_INFO("%s not yet implemented\n", __func__)
58
#define NOT_SUPPORTED() LOG_INFO("%s not supported\n", __func__)
59
60
#if ENABLE_DEBUG
69
#define CHECK_PARAM_RET(cond, err) if (!(cond)) \
70
{ \
71
DEBUG("%s parameter condition (" #cond ") " \
72
"not fulfilled\n", __func__); \
73
return err; \
74
}
75
83
#define CHECK_PARAM(cond) if (!(cond)) \
84
{ \
85
DEBUG("%s parameter condition (" #cond ") " \
86
"not fulfilled\n", __func__); \
87
return; \
88
}
89
90
#else
/* ENABLE_DEBUG */
91
92
#define CHECK_PARAM_RET(cond, err) if (!(cond)) { return err; }
93
#define CHECK_PARAM(cond) if (!(cond)) { return; }
94
95
#endif
/* ENABLE_DEBUG */
96
101
#ifdef CPU_ESP32
102
#define system_get_cpu_freq ets_get_cpu_frequency
103
#define system_update_cpu_freq ets_update_cpu_frequency
104
#endif
/* CPU_FAM_ESP32 */
110
#ifndef USEC_PER_MSEC
111
#define USEC_PER_MSEC 1000UL
112
#endif
113
114
#ifndef MSEC_PER_SEC
115
#define MSEC_PER_SEC 1000UL
116
#endif
117
118
#ifdef __cplusplus
119
}
120
#endif
121
122
#endif
/* DOXYGEN */
123
124
#endif
/* ESP_COMMON_H */
utils.h
Various helper macros.
esp_common_log.h
Common log macros for ESP SoCs.
xtstr.h
Macro to return string representation of x.
Generated on Fri Nov 15 2024 22:46:35 by
1.9.8