-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5adb2d7
commit 4e45149
Showing
258 changed files
with
107,394 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
src/etl/.vscode/settings.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name=Embedded Template Library (ETL) | ||
version=19.3.5 | ||
author= John Wellbelove <[email protected]> | ||
maintainer=John Wellbelove <[email protected]> | ||
license=MIT | ||
sentence=ETL. A C++ template library tailored for embedded systems. | ||
paragraph= | ||
category=Other | ||
url=https://www.etlcpp.com/ | ||
architectures=* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
///\file | ||
|
||
/****************************************************************************** | ||
The MIT License(MIT) | ||
Embedded Template Library. | ||
https://github.com/ETLCPP/etl | ||
https://www.etlcpp.com | ||
Copyright(c) 2018 jwellbelove | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files(the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and / or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions : | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
******************************************************************************/ | ||
|
||
#ifndef ETL_ABSOLUTE_INCLUDED | ||
#define ETL_ABSOLUTE_INCLUDED | ||
|
||
#include "type_traits.h" | ||
|
||
namespace etl | ||
{ | ||
//*************************************************************************** | ||
// For signed types. | ||
//*************************************************************************** | ||
template <typename T> | ||
ETL_CONSTEXPR typename etl::enable_if<etl::is_signed<T>::value, T>::type | ||
absolute(T value) | ||
{ | ||
return (value < T(0)) ? -value : value; | ||
} | ||
|
||
//*************************************************************************** | ||
// For unsigned types. | ||
//*************************************************************************** | ||
template <typename T> | ||
ETL_CONSTEXPR typename etl::enable_if<etl::is_unsigned<T>::value, T>::type | ||
absolute(T value) | ||
{ | ||
return value; | ||
} | ||
} | ||
|
||
#endif | ||
|
Oops, something went wrong.