mirror of
https://github.com/ETLCPP/etl.git
synced 2026-11-09 14:49:53 +08:00
Merge branch 'hotfix/arduino-compatibility' into development
This commit is contained in:
commit
3857830703
1
.gitignore
vendored
1
.gitignore
vendored
@ -277,3 +277,4 @@ test/Makefile
|
||||
test/vs2019/enc_temp_folder
|
||||
test/vs2019/.leu
|
||||
test/etl_test_log.txt
|
||||
temp/create_arduino_library.py
|
||||
|
||||
80
arduino/Embedded_Template_Library.h
Normal file
80
arduino/Embedded_Template_Library.h
Normal file
@ -0,0 +1,80 @@
|
||||
|
||||
#ifndef ETL_EMBEDDED_TEMPLATE_LIBRARY_INCLUDED
|
||||
#define ETL_EMBEDDED_TEMPLATE_LIBRARY_INCLUDED
|
||||
|
||||
#if defined(TEENSYDUINO)
|
||||
|
||||
#if defined(__AVR_ATmega32U4__)
|
||||
#define ARDUINO_BOARD "Teensy 2.0"
|
||||
#elif defined(__AVR_AT90USB1286__)
|
||||
#define ARDUINO_BOARD "Teensy++ 2.0"
|
||||
#elif defined(__MK20DX128__)
|
||||
#define ARDUINO_BOARD "Teensy 3.0"
|
||||
#elif defined(__MK20DX256__)
|
||||
#define ARDUINO_BOARD "Teensy 3.2" // and Teensy 3.1
|
||||
#elif defined(__MKL26Z64__)
|
||||
#define ARDUINO_BOARD "Teensy LC"
|
||||
#elif defined(__MK64FX512__)
|
||||
#define ARDUINO_BOARD "Teensy 3.5"
|
||||
#elif defined(__MK66FX1M0__)
|
||||
#define ARDUINO_BOARD "Teensy 3.6"
|
||||
#else
|
||||
#error "Unknown"
|
||||
#endif
|
||||
|
||||
#else // --------------- Arduino ------------------
|
||||
|
||||
#if defined(ARDUINO_AVR_ADK)
|
||||
#define ARDUINO_BOARD "Mega Adk"
|
||||
#elif defined(ARDUINO_AVR_BT)
|
||||
#define ARDUINO_BOARD "Bt"
|
||||
#elif defined(ARDUINO_AVR_DUEMILANOVE)
|
||||
#define ARDUINO_BOARD "Duemilanove"
|
||||
#elif defined(ARDUINO_AVR_ESPLORA)
|
||||
#define ARDUINO_BOARD "Esplora"
|
||||
#elif defined(ARDUINO_AVR_ETHERNET)
|
||||
#define ARDUINO_BOARD "Ethernet"
|
||||
#elif defined(ARDUINO_AVR_FIO)
|
||||
#define ARDUINO_BOARD "Fio"
|
||||
#elif defined(ARDUINO_AVR_GEMMA)
|
||||
#define ARDUINO_BOARD "Gemma"
|
||||
#elif defined(ARDUINO_AVR_LEONARDO)
|
||||
#define ARDUINO_BOARD "Leonardo"
|
||||
#elif defined(ARDUINO_AVR_LILYPAD)
|
||||
#define ARDUINO_BOARD "Lilypad"
|
||||
#elif defined(ARDUINO_AVR_LILYPAD_USB)
|
||||
#define ARDUINO_BOARD "Lilypad Usb"
|
||||
#elif defined(ARDUINO_AVR_MEGA)
|
||||
#define ARDUINO_BOARD "Mega"
|
||||
#elif defined(ARDUINO_AVR_MEGA2560)
|
||||
#define ARDUINO_BOARD "Mega 2560"
|
||||
#elif defined(ARDUINO_AVR_MICRO)
|
||||
#define ARDUINO_BOARD "Micro"
|
||||
#elif defined(ARDUINO_AVR_MINI)
|
||||
#define ARDUINO_BOARD "Mini"
|
||||
#elif defined(ARDUINO_AVR_NANO)
|
||||
#define ARDUINO_BOARD "Nano"
|
||||
#elif defined(ARDUINO_AVR_NG)
|
||||
#define ARDUINO_BOARD "NG"
|
||||
#elif defined(ARDUINO_AVR_PRO)
|
||||
#define ARDUINO_BOARD "Pro"
|
||||
#elif defined(ARDUINO_AVR_ROBOT_CONTROL)
|
||||
#define ARDUINO_BOARD "Robot Ctrl"
|
||||
#elif defined(ARDUINO_AVR_ROBOT_MOTOR)
|
||||
#define ARDUINO_BOARD "Robot Motor"
|
||||
#elif defined(ARDUINO_AVR_UNO)
|
||||
#define ARDUINO_BOARD "Uno"
|
||||
#elif defined(ARDUINO_AVR_YUN)
|
||||
#define ARDUINO_BOARD "Yun"
|
||||
#elif defined(ARDUINO_SAM_DUE)
|
||||
#define ARDUINO_BOARD "Due"
|
||||
#elif defined(ARDUINO_SAMD_ZERO)
|
||||
#define ARDUINO_BOARD "Zero"
|
||||
#elif defined(ARDUINO_ARC32_TOOLS)
|
||||
#define ARDUINO_BOARD "101"
|
||||
#else
|
||||
#error "Unknown"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
47
arduino/create_arduino_library.py
Normal file
47
arduino/create_arduino_library.py
Normal file
@ -0,0 +1,47 @@
|
||||
|
||||
import shutil
|
||||
import os
|
||||
|
||||
# Get the current Path of the script
|
||||
arduino_dir = os.path.dirname(__file__)
|
||||
print('arduino_dir ', arduino_dir)
|
||||
|
||||
etl_dir = os.path.dirname(arduino_dir)
|
||||
print('etl_dir ', etl_dir)
|
||||
|
||||
etl_include_dir = os.path.join(etl_dir, 'include')
|
||||
print('etl_include_dir ', etl_include_dir)
|
||||
|
||||
common_dir = os.path.dirname(etl_dir)
|
||||
print('common_dir ', common_dir)
|
||||
|
||||
etl_arduino_dir = os.path.join(common_dir, 'etl-arduino')
|
||||
print('etl_arduino_dir ', etl_arduino_dir)
|
||||
|
||||
etl_arduino_src_dir = os.path.join(etl_arduino_dir, 'src')
|
||||
print('etl_arduino_src_dir ', etl_arduino_src_dir)
|
||||
|
||||
print('')
|
||||
|
||||
# Copy the library properties
|
||||
filename = 'library.properties'
|
||||
source = os.path.join(etl_dir, filename)
|
||||
destination = os.path.join(etl_arduino_dir, filename)
|
||||
print('source = ', source)
|
||||
print('destination = ', destination)
|
||||
shutil.copyfile(source, destination)
|
||||
|
||||
# Copy the Arduino ETL header
|
||||
filename = 'Embedded_Template_Library.h'
|
||||
source = os.path.join(arduino_dir, filename)
|
||||
destination = os.path.join(etl_arduino_src_dir, filename)
|
||||
print('source = ', source)
|
||||
print('destination = ', destination)
|
||||
shutil.copyfile(source, destination)
|
||||
|
||||
# Copy the ETL headers
|
||||
source = etl_include_dir
|
||||
destination = etl_arduino_src_dir
|
||||
print('source = ', source)
|
||||
print('destination = ', destination)
|
||||
shutil.copytree(source, destination, dirs_exist_ok = True)
|
||||
@ -53,6 +53,8 @@ SOFTWARE.
|
||||
#include <functional>
|
||||
#endif
|
||||
|
||||
#include "private/minmax_push.h"
|
||||
|
||||
namespace etl
|
||||
{
|
||||
// Declare prototypes of the ETL's sort functions
|
||||
@ -3417,4 +3419,6 @@ namespace etl
|
||||
#endif
|
||||
}
|
||||
|
||||
#include "private/minmax_pop.h"
|
||||
|
||||
#endif
|
||||
|
||||
@ -33,7 +33,6 @@ SOFTWARE.
|
||||
* This file is intended to evaluated multiple times by design.
|
||||
*/
|
||||
|
||||
#if defined(ETL_COMPILER_MICROSOFT)
|
||||
#pragma pop_macro("min")
|
||||
#pragma pop_macro("max")
|
||||
#endif
|
||||
#pragma pop_macro("min")
|
||||
#pragma pop_macro("max")
|
||||
|
||||
|
||||
@ -33,9 +33,7 @@ SOFTWARE.
|
||||
* This file is intended to evaluated multiple times by design.
|
||||
*/
|
||||
|
||||
#if defined(ETL_COMPILER_MICROSOFT)
|
||||
#pragma push_macro("min")
|
||||
#pragma push_macro("max")
|
||||
#undef min
|
||||
#undef max
|
||||
#endif
|
||||
#pragma push_macro("min")
|
||||
#pragma push_macro("max")
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
@ -39,7 +39,7 @@ SOFTWARE.
|
||||
|
||||
#define ETL_VERSION_MAJOR 19
|
||||
#define ETL_VERSION_MINOR 3
|
||||
#define ETL_VERSION_PATCH 5
|
||||
#define ETL_VERSION_PATCH 6
|
||||
#define ETL_VERSION ETL_STRINGIFY(ETL_VERSION_MAJOR) "." ETL_STRINGIFY(ETL_VERSION_MINOR) "." ETL_STRINGIFY(ETL_VERSION_PATCH)
|
||||
#define ETL_VERSION_W ETL_STRINGIFY(ETL_VERSION_MAJOR) L"." ETL_STRINGIFY(ETL_VERSION_MINOR) L"." ETL_STRINGIFY(ETL_VERSION_PATCH)
|
||||
#define ETL_VERSION_U16 ETL_STRINGIFY(ETL_VERSION_MAJOR) u"." ETL_STRINGIFY(ETL_VERSION_MINOR) u"." ETL_STRINGIFY(ETL_VERSION_PATCH)
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
{
|
||||
"name": "Embedded Template Library",
|
||||
"version": "19.3.5",
|
||||
"name": "ETL Embedded Template Library",
|
||||
"version": "19.3.6",
|
||||
"author s": {
|
||||
"name": "John Wellbelove",
|
||||
"email": "john.wellbelove@etlcpp.com"
|
||||
},
|
||||
"homepage": "https://www.etlcpp.com/",
|
||||
"license": "MIT",
|
||||
"description": "A C++ template library tailored for embedded systems.",
|
||||
"description": "ETL. A C++ template library tailored for embedded systems.",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ETLCPP/etl.git"
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
name=Embedded Template Library
|
||||
version=19.3.5
|
||||
name=Embedded Template Library ETL
|
||||
version=19.3.6
|
||||
author= John Wellbelove <john.wellbelove@etlcpp.com>
|
||||
maintainer=John Wellbelove <john.wellbelove@etlcpp.com>
|
||||
license=MIT
|
||||
sentence=A C++ template library tailored for embedded systems.
|
||||
sentence=ETL. A C++ template library tailored for embedded systems.
|
||||
paragraph=
|
||||
category=Other
|
||||
url=https://www.etlcpp.com/
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
===============================================================================
|
||||
19.3.6
|
||||
Arduino compatibility mods.
|
||||
|
||||
===============================================================================
|
||||
19.3.5
|
||||
Change std::move to etl::move in etl::forward_list
|
||||
|
||||
@ -1240,6 +1240,7 @@
|
||||
<ClInclude Include="..\..\..\unittest-cpp\UnitTest++\UnitTest++.h" />
|
||||
<ClInclude Include="..\..\..\unittest-cpp\UnitTest++\UnitTestPP.h" />
|
||||
<ClInclude Include="..\..\..\unittest-cpp\UnitTest++\XmlTestReporter.h" />
|
||||
<ClInclude Include="..\..\arduino\Embedded_Template_Library.h" />
|
||||
<ClInclude Include="..\..\include\etl\array_view.h" />
|
||||
<ClInclude Include="..\..\include\etl\array_wrapper.h" />
|
||||
<ClInclude Include="..\..\include\etl\atomic.h" />
|
||||
@ -1983,6 +1984,7 @@
|
||||
<None Include="..\..\.github\workflows\gcc.yml" />
|
||||
<None Include="..\..\.github\workflows\vs2019.yml" />
|
||||
<None Include="..\..\appveyor.yml" />
|
||||
<None Include="..\..\arduino\create_arduino_library.py" />
|
||||
<None Include="..\..\conanfile.py" />
|
||||
<None Include="..\..\etl.pspimage" />
|
||||
<None Include="..\..\etl.xar" />
|
||||
|
||||
@ -85,6 +85,9 @@
|
||||
<Filter Include="Resource Files\CI\Appveyor">
|
||||
<UniqueIdentifier>{74399f00-a7a3-47e3-9b27-d01fb2b5ce87}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ETL\Arduino">
|
||||
<UniqueIdentifier>{afc65d0e-d846-4e30-8723-06c8cefa3a36}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\include\etl\enum_type.h">
|
||||
@ -900,6 +903,9 @@
|
||||
<ClInclude Include="..\..\include\etl\mutex\mutex_clang_sync.h">
|
||||
<Filter>ETL\Utilities\Mutex</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\arduino\Embedded_Template_Library.h">
|
||||
<Filter>ETL\Arduino</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\main.cpp">
|
||||
@ -1510,6 +1516,9 @@
|
||||
<None Include="..\..\conanfile.py">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="..\..\arduino\create_arduino_library.py">
|
||||
<Filter>ETL\Arduino</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="..\..\include\etl\file_error_numbers.txt">
|
||||
@ -1548,4 +1557,4 @@
|
||||
<Filter>Resource Files\Images</Filter>
|
||||
</Image>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
Loading…
x
Reference in New Issue
Block a user