Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/development'
Browse files Browse the repository at this point in the history
# Conflicts:
#	CMakeLists.txt
  • Loading branch information
jwellbelove committed Mar 18, 2018
1 parent 4277657 commit d7f9d1a
Show file tree
Hide file tree
Showing 165 changed files with 757 additions and 531 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ add_library(etl
)
target_include_directories(etl
PUBLIC
src/
src/atomic
src/profiles
include/etl/
include/etl/atomic
include/etl/profiles
PRIVATE
src/private
include/etl/private
)

if (${ETL_PROFILE} STREQUAL DEFAULT)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/callback_timer.h → include/etl/callback_timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ SOFTWARE.
#include "atomic.h"

#undef ETL_FILE
#define ETL_FILE "42"
#define ETL_FILE "43"

#if !defined(ETL_CALLBACK_TIMER_USE_ATOMIC_LOCK) && !defined(ETL_CALLBACK_TIMER_USE_INTERRUPT_LOCK)
#error ETL_CALLBACK_TIMER_USE_ATOMIC_LOCK or ETL_CALLBACK_TIMER_USE_INTERRUPT_LOCK not defined
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
56 changes: 56 additions & 0 deletions include/etl/experimental/atomic.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/******************************************************************************
The MIT License(MIT)
Embedded Template Library.
https://github.com/ETLCPP/etl
https://www.etlcpp.com
Copyright(c) 2017 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_ATOMIC__
#define __ETL_ATOMIC__

#include "platform.h"

#if ETL_ATOMIC_SUPPORTED == 1
#include <atomic>

namespace etl
{
typedef std::atomic<uint32_t> atomic_uint32_t;
}
#define ETL_CPP11_ATOMIC_AVAILABLE 1
#elif defined(ETL_COMPILER_ARM)
#include "atomic/atomic_arm.h"
#define ETL_ETL_ATOMIC_AVAILABLE 1
#elif defined(ETL_COMPILER_GCC)
#include "atomic/atomic_gcc.h"
#define ETL_ATOMIC_AVAILABLE 1
#elif defined(ETL_COMPILER_MSVC)
#include "atomic/atomic_windows.h"
#define ETL_ATOMIC_AVAILABLE 1
#else
#warning NO ATOMIC SUPPORT DEFINED!
#define ETL_ATOMIC_AVAILABLE 0
#endif

#endif
57 changes: 57 additions & 0 deletions include/etl/experimental/spsc_queue.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@

#include "platform.h"

#include "atomic.h"

struct spsc_queue_implementation
{
enum
{
UNKNOWN,
STD_ATOMIC,
ETL_ATOMIC,
CMSIS_RTOS2,
FREERTOS,
GCC,
WIN32
};
};

template <typename T, const size_t IMPLEMENTATION = spsc_queue_implementation::UNKNOWN>
class ispsc_queue;

template <typename T, const size_t SIZE, const size_t IMPLEMENTATION = spsc_queue_implementation::UNKNOWN>
class spsc_queue : public ispsc_queue;

#if ETL_ATOMIC_AVAILABLE
template <typename T>
class ispsc_queue<T, spsc_queue_implementation::STD_ATOMIC>
{

};

template <typename T, const size_t SIZE>
class spsc_queue<T, SIZE, spsc_queue_implementation::STD_ATOMIC>
: public ispsc_queue<T, spsc_queue_implementation::STD_ATOMIC>
{

};
#endif

#if ETL_OPERATING_SYSTEM == ETL_CMSIS_RTOS2
template <typename T, const size_t SIZE>
class spsc_queue<T, SIZE, spsc_queue_implementation::CMSIS_RTOS2>
: public ispsc_queue<T, spsc_queue_implementation::CMSIS_RTOS2>
{

};
#endif

#if ETL_OPERATING_SYSTEM == ETL_FREERTOS
template <typename T, const size_t SIZE>
class spsc_queue<T, SIZE, spsc_queue_implementation::FREERTOS>
: public ispsc_queue<T, spsc_queue_implementation::FREERTOS>
{

};
#endif
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,7 @@
39 message_bus
40 factory / variant_pool
41 array_view
42 string_view
43 callback_timer
44 message_timer
45 type_lookup
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/message_timer.h → include/etl/message_timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ SOFTWARE.
#include "atomic.h"

#undef ETL_FILE
#define ETL_FILE "41"
#define ETL_FILE "44"

#if !defined(ETL_MESSAGE_TIMER_USE_ATOMIC_LOCK) && !defined(ETL_MESSAGE_TIMER_USE_INTERRUPT_LOCK)
#error ETL_MESSAGE_TIMER_USE_ATOMIC_LOCK or ETL_MESSAGE_TIMER_USE_INTERRUPT_LOCK not defined
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
60 changes: 60 additions & 0 deletions include/etl/profiles/etl_profile.h
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) 2017 jwellbelove, scott-eddy
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_PROFILE_H__
#define __ETL_PROFILE_H__
#ifdef PROFILE_MSVC
#include "msvc_x86.h"
#elif PROFILE_GCC_GENERIC
#include "gcc_generic.h"
#elif PROFILE_GCC_LINUX_X86
#include "gcc_linux_x86.h"
#elif PROFILE_GCC_WINDOWS_X86
#include "gcc_windows_x86.h"
#elif PROFILE_ARM_V5_GENERIC
#include "armv5.h"
#elif PROFILE_ARM_V6_GENERIC
#include "armv6.h"
#elif PROFILE_ARDUINO
#include "arduino_arm.h"
#elif PROFILE_TICC
#include "ticc.h"
#elif PROFILE_CPP03_GENERIC
#include "cpp03.h"
#elif PROFILE_CPP11_GENERIC
#include "cpp11.h"
#elif PROFILE_CPP14_GENERIC
#include "cpp14.h"
#elif PROFILE_CUSTOM
#include "custom_profile.h"
#else
#error Must provide a profile header file when buiding ETL. See https://www.etlcpp.com/setup.html
#endif

#endif // __ETL_PROFILE_H_
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/type_lookup.h → include/etl/type_lookup.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ SOFTWARE.
#include "static_assert.h"

#undef ETL_FILE
#define ETL_FILE "41"
#define ETL_FILE "45"

#if 0
#error THIS HEADER IS A GENERATOR. DO NOT INCLUDE.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ SOFTWARE.
#include "static_assert.h"

#undef ETL_FILE
#define ETL_FILE "41"
#define ETL_FILE "45"

/*[[[cog
import cog
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 0 additions & 11 deletions src/utility.h → include/etl/utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,6 @@ SOFTWARE.

namespace etl
{
//***************************************************************************
/// exchange
//***************************************************************************
template <typename T, typename U = T>
T exchange(T& object, U& new_value)
{
T old_value = object;
object = new_value;
return old_value;
}

//***************************************************************************
/// exchange (const)
//***************************************************************************
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions src/version.h → include/etl/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ SOFTWARE.
/// Definitions of the ETL version
///\ingroup utilities

#define ETL_VERSION "10.21.2"
#define ETL_VERSION_MAJOR 10
#define ETL_VERSION_MINOR 21
#define ETL_VERSION_PATCH 2
#define ETL_VERSION "11.00.0"
#define ETL_VERSION_MAJOR 11
#define ETL_VERSION_MINOR 0
#define ETL_VERSION_PATCH 0

#endif

File renamed without changes.
File renamed without changes.
16 changes: 8 additions & 8 deletions src/c/ecl_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ SOFTWARE.
#include <stdint.h>
#include <assert.h>

#include "ecl_timer.h"
#include "../../include/etl/c/ecl_timer.h"

//*****************************************************************************
// Internal timer list
Expand Down Expand Up @@ -326,7 +326,7 @@ ecl_timer_id_t ecl_timer_register(void (*pcallback_)(),
ecl_timer_result_t ecl_timer_unregister(ecl_timer_id_t id_)
{
assert(ecl.ptimers != 0);

ecl_timer_result_t result = ECL_TIMER_FAIL;

if (id_ != ECL_TIMER_NO_TIMER)
Expand Down Expand Up @@ -376,7 +376,7 @@ ecl_timer_result_t ecl_timer_is_running()
/// Clears the timer of data.
//*******************************************
void ecl_timer_clear()
{
{
ecl_timer_list_clear();

int i;
Expand All @@ -398,7 +398,7 @@ void ecl_timer_clear()
ecl_timer_result_t ecl_timer_tick(uint32_t count)
{
assert(ecl.ptimers != 0);

if (ecl.enabled)
{
if (ECL_TIMER_PROCESSING_ENABLED)
Expand Down Expand Up @@ -452,7 +452,7 @@ ecl_timer_result_t ecl_timer_tick(uint32_t count)
ecl_timer_result_t ecl_timer_start(ecl_timer_id_t id_, ecl_timer_start_t immediate_)
{
assert(ecl.ptimers != 0);

ecl_timer_result_t result = ECL_TIMER_FAIL;

// Valid timer id?
Expand Down Expand Up @@ -490,7 +490,7 @@ ecl_timer_result_t ecl_timer_start(ecl_timer_id_t id_, ecl_timer_start_t immedia
ecl_timer_result_t ecl_timer_stop(ecl_timer_id_t id_)
{
assert(ecl.ptimers != 0);

ecl_timer_result_t result = ECL_TIMER_FAIL;

// Valid timer id?
Expand Down Expand Up @@ -520,7 +520,7 @@ ecl_timer_result_t ecl_timer_stop(ecl_timer_id_t id_)
ecl_timer_result_t ecl_timer_set_period(ecl_timer_id_t id_, ecl_timer_time_t period_)
{
assert(ecl.ptimers != 0);

if (ecl_timer_stop(id_))
{
ecl.ptimers[id_].period = period_;
Expand All @@ -536,7 +536,7 @@ ecl_timer_result_t ecl_timer_set_period(ecl_timer_id_t id_, ecl_timer_time_t per
ecl_timer_result_t ecl_timer_set_mode(ecl_timer_id_t id_, ecl_timer_mode_t repeating_)
{
assert(ecl.ptimers != 0);

if (ecl_timer_stop(id_))
{
ecl.ptimers[id_].repeating = repeating_;
Expand Down
4 changes: 2 additions & 2 deletions src/private/pvoidvector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
******************************************************************************/

#include "../platform.h"
#include "pvoidvector.h"
#include "../../include/etl/platform.h"
#include "../../include/etl/private/pvoidvector.h"

namespace etl
{
Expand Down
6 changes: 6 additions & 0 deletions support/Release notes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
===============================================================================
11.00.0
New directory structure.
C & CPP files in src/
H files in include/etl/

===============================================================================
10.21.2
Added version.h
Expand Down
Loading

0 comments on commit d7f9d1a

Please sign in to comment.