mirror of
https://github.com/ETLCPP/etl.git
synced 2026-04-30 19:09:10 +08:00
Merge branch 'feature/add-a-couple-of-arduino-examples-#397' into development
This commit is contained in:
commit
3ee84e6606
3
.gitignore
vendored
3
.gitignore
vendored
@ -312,3 +312,6 @@ test/sanity-check/c++17/cmake_install.cmake
|
||||
test/sanity-check/c++17/CMakeCache.txt
|
||||
test/sanity-check/c++17/libt17.a
|
||||
test/sanity-check/c++17/Makefile
|
||||
test/vs2019/Debug LLVM
|
||||
test/vs2019/DebugLLVMNoSTL
|
||||
test/vs2019/DebugNoSTL
|
||||
|
||||
@ -56,3 +56,7 @@ Any help porting the library to work under different platforms and compilers wou
|
||||
I am especially interested in people who are using Keil, IAR, Green Hills, TI Code Composer etc, bare metal or RTOS, and DSPs.
|
||||
|
||||
See (https://www.etlcpp.com) for up-to-date information.
|
||||
|
||||
**Arduino library:**
|
||||
|
||||
The content of this repo is available as a library in the Arduino IDE (search for the "Embedded Template Library" in the IDE library manager). The Arduino library repository is available at ```https://github.com/ETLCPP/etl-arduino```, see there for more details.
|
||||
|
||||
@ -27,6 +27,10 @@ print('etl_dir = ', etl_dir)
|
||||
include_dir = os.path.join(etl_dir, 'include')
|
||||
print('include_dir = ', include_dir)
|
||||
|
||||
# Get the ETL arduino_examples folder
|
||||
arduino_examples_dir = os.path.join(arduino_dir, 'examples')
|
||||
print('examples_dir = ', arduino_examples_dir)
|
||||
|
||||
# Get the root folder of both repositories
|
||||
common_dir = os.path.dirname(etl_dir)
|
||||
print('common_dir = ', common_dir)
|
||||
@ -39,6 +43,10 @@ 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)
|
||||
|
||||
# Get the ETL Arduino examples repository folder
|
||||
etl_arduino_examples_dir = os.path.join(etl_arduino_dir, 'examples')
|
||||
print('etl_arduino_examples_dir = ', etl_arduino_examples_dir)
|
||||
|
||||
print('')
|
||||
|
||||
# Copy the library properties
|
||||
@ -70,3 +78,13 @@ print('Copy the ETL headers')
|
||||
print(' From :', source)
|
||||
print(' To :', destination)
|
||||
shutil.copytree(source, destination, dirs_exist_ok = True)
|
||||
|
||||
print('')
|
||||
|
||||
# Copy the ETL arduino_examples
|
||||
source = arduino_examples_dir
|
||||
destination = etl_arduino_examples_dir
|
||||
print('Copy the ETL Arduino examples')
|
||||
print(' From :', source)
|
||||
print(' To :', destination)
|
||||
shutil.copytree(source, destination, dirs_exist_ok = True)
|
||||
|
||||
@ -0,0 +1,12 @@
|
||||
#include "Embedded_Template_Library.h" // This is required for any more etl import when using Arduino IDE
|
||||
|
||||
void setup()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void loop()
|
||||
{
|
||||
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
#include "Embedded_Template_Library.h"
|
||||
#include "etl/vector.h"
|
||||
|
||||
template <typename T>
|
||||
void print_vector(etl::ivector<T> const & vec_in)
|
||||
{
|
||||
Serial.print(F("print vector content | size ")); Serial.print(vec_in.size()); Serial.print(F(" | capacity ")); Serial.println(vec_in.capacity());
|
||||
Serial.print(F("content | "));
|
||||
|
||||
for (T const & elem : vec_in)
|
||||
{
|
||||
Serial.print(elem);
|
||||
Serial.print(F(" | "));
|
||||
}
|
||||
|
||||
Serial.println();
|
||||
}
|
||||
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(115200);
|
||||
delay(100);
|
||||
Serial.println(F("booted"));
|
||||
|
||||
etl::vector<int, 12> vec_int;
|
||||
|
||||
Serial.println(F("initialized vec_int"));
|
||||
print_vector(vec_int);
|
||||
|
||||
vec_int.push_back(1);
|
||||
vec_int.push_back(2);
|
||||
Serial.println(F("pushed to vec_int"));
|
||||
print_vector(vec_int);
|
||||
|
||||
vec_int.pop_back();
|
||||
Serial.println(F("pop from vec_int; returns no value"));
|
||||
print_vector(vec_int);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
|
||||
}
|
||||
@ -4982,6 +4982,8 @@
|
||||
<None Include="..\..\.github\workflows\vs2019.yml" />
|
||||
<None Include="..\..\appveyor.yml" />
|
||||
<None Include="..\..\arduino\create_arduino_library.py" />
|
||||
<None Include="..\..\arduino\examples\Example_0_import_etl\Example_0_import_etl.ino" />
|
||||
<None Include="..\..\arduino\examples\Vector_Examples\Example_Vector_1_simple_use\Example_Vector_1_simple_use.ino" />
|
||||
<None Include="..\..\conanfile.py" />
|
||||
<None Include="..\..\etl.pspimage" />
|
||||
<None Include="..\..\etl.xar" />
|
||||
|
||||
@ -106,6 +106,18 @@
|
||||
<Filter Include="Source Files\Scripts">
|
||||
<UniqueIdentifier>{562466b5-677d-4448-9e9e-f70805cd71ad}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ETL\Arduino\Examples">
|
||||
<UniqueIdentifier>{1d6ea286-57ad-4960-9343-9d2376087b24}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ETL\Arduino\Examples\Example_0_import_etl">
|
||||
<UniqueIdentifier>{5eace791-3e53-4205-a04d-2aba3bac6b47}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ETL\Arduino\Examples\Vector_Examples">
|
||||
<UniqueIdentifier>{2b770849-325e-4ec5-a7f3-9a192cd40dca}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ETL\Arduino\Examples\Vector_Examples\Example_Vector_1_simple_use">
|
||||
<UniqueIdentifier>{0e4d2126-b9b7-4eef-b5ca-18363b1e01ce}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\include\etl\enum_type.h">
|
||||
@ -2614,6 +2626,12 @@
|
||||
<None Include="..\runtests.sh">
|
||||
<Filter>Source Files\Scripts</Filter>
|
||||
</None>
|
||||
<None Include="..\..\arduino\examples\Example_0_import_etl\Example_0_import_etl.ino">
|
||||
<Filter>ETL\Arduino\Examples\Example_0_import_etl</Filter>
|
||||
</None>
|
||||
<None Include="..\..\arduino\examples\Vector_Examples\Example_Vector_1_simple_use\Example_Vector_1_simple_use.ino">
|
||||
<Filter>ETL\Arduino\Examples\Vector_Examples\Example_Vector_1_simple_use</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="..\..\support\Release notes.txt">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user