Skip to content

Commit b550015

Browse files
committed
docs(): Add core compatibility guide
1 parent f9bb62a commit b550015

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

docs/en/guides/core_compatibility.rst

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
Compatibility Guide for ESP32 Arduino Core
2+
====================================================
3+
4+
Introduction
5+
------------
6+
7+
Welcome to the compatibility guide for library developers aiming to support multiple versions of the ESP32 Arduino core. This documentation provides essential tips and best practices for ensuring compatibility with 2.x, 3.x and future versions of the ESP32 Arduino core.
8+
9+
Code Adaptations
10+
----------------
11+
12+
To ensure compatibility with both versions of the ESP32 Arduino core, developers should utilize conditional compilation directives in their code. Below is an example of how to conditionally include code based on the ESP32 Arduino core version::
13+
14+
.. code-block:: cpp
15+
16+
#if ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(3, 0, 0)
17+
// Code for ESP32 Arduino core version 3.x
18+
#else
19+
// Code for ESP32 Arduino core version 2.x
20+
#endif
21+
22+
Version Print
23+
-------------
24+
25+
To easily print the ESP32 Arduino core version at runtime, developers can use the `ESP_ARDUINO_VERSION_STR` macro. Below is an example of how to print the ESP32 Arduino core version::
26+
27+
.. code-block:: cpp
28+
29+
Serial.printf(" ESP32 Arduino core version: %s\n", ESP_ARDUINO_VERSION_STR);
30+
31+
API Differences
32+
---------------
33+
34+
Developers should be aware, that there may be API differences between major versions of the ESP32 Arduino core. For this we created a `Migration guide <https://docs.espressif.com/projects/arduino-esp32/en/latest/migration_guides.html>`_. to help developers transition from between major versions of the ESP32 Arduino core.
35+
36+
Library Testing
37+
---------------
38+
39+
We have added an External Library Test CI job, which tests external libraries with the latest version of the ESP32 Arduino core to help developers ensure compatibility with the latest version of the ESP32 Arduino core.
40+
If you want to include your library in the External Library Test CI job, please follow the instructions in the `External Libraries Test <https://docs.espressif.com/projects/arduino-esp32/en/latest/esp32/external_libraries_test.html>`_.

0 commit comments

Comments
 (0)