Skip to content

Commit f1cbd3b

Browse files
committed
Create esp_arduino_version.h
1 parent e55d657 commit f1cbd3b

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

cores/esp32/esp_arduino_version.h

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Copyright 2019 Espressif Systems (Shanghai) PTE LTD
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#pragma once
16+
17+
#ifdef __cplusplus
18+
extern "C" {
19+
#endif
20+
21+
/** Major version number (X.x.x) */
22+
#define ESP_ARDUINO_VERSION_MAJOR 2
23+
/** Minor version number (x.X.x) */
24+
#define ESP_ARDUINO_VERSION_MINOR 0
25+
/** Patch version number (x.x.X) */
26+
#define ESP_ARDUINO_VERSION_PATCH 0
27+
28+
/**
29+
* Macro to convert ARDUINO version number into an integer
30+
*
31+
* To be used in comparisons, such as ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(2, 0, 0)
32+
*/
33+
#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) ((major << 16) | (minor << 8) | (patch))
34+
35+
/**
36+
* Current ARDUINO version, as an integer
37+
*
38+
* To be used in comparisons, such as ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(2, 0, 0)
39+
*/
40+
#define ESP_ARDUINO_VERSION ESP_ARDUINO_VERSION_VAL(ESP_ARDUINO_VERSION_MAJOR, \
41+
ESP_ARDUINO_VERSION_MINOR, \
42+
ESP_ARDUINO_VERSION_PATCH)
43+
44+
#ifdef __cplusplus
45+
}
46+
#endif

0 commit comments

Comments
 (0)