mirror of
https://github.com/ETLCPP/etl.git
synced 2026-04-30 19:09:10 +08:00
Merge remote-tracking branch 'origin/development'
# Conflicts: # examples/ArmTimerCallbacks - C++/ArmTimerCallbacks.uvprojx # include/etl/nullptr.h
This commit is contained in:
parent
0c721be429
commit
aff5e2f7aa
@ -10,8 +10,8 @@
|
||||
<TargetName>Target 1</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<pCCUsed>6090000::V6.9::.\ARMCLANG</pCCUsed>
|
||||
<uAC6>1</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
<Device>STM32F401RETx</Device>
|
||||
|
||||
@ -12,10 +12,18 @@
|
||||
|
||||
#if (__CC_ARM == 1)
|
||||
// ARM5 compiler
|
||||
#if defined(ETL_NO_STL)
|
||||
#include "etl/profiles/armv5_no_stl.h"
|
||||
#else
|
||||
#include "etl/profiles/armv5.h"
|
||||
#endif
|
||||
#else
|
||||
// ARM6 compiler
|
||||
#if defined(ETL_NO_STL)
|
||||
#include "etl/profiles/armv6_no_stl.h"
|
||||
#else
|
||||
#include "etl/profiles/armv6.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,13 +1,17 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
//#if (__cplusplus < 201103L)
|
||||
extern "C"
|
||||
{
|
||||
#include "Board_LED.h" // ::Board Support:LED
|
||||
#include "Board_Buttons.h" // ::Board Support:Buttons
|
||||
|
||||
#include "stm32f4xx.h" // Device header
|
||||
//#endif
|
||||
#include "Board_LED.h" // ::Board Support:LED
|
||||
#include "Board_Buttons.h" // ::Board Support:Buttons
|
||||
//#if (__cplusplus < 201103L)
|
||||
}
|
||||
//#endif
|
||||
|
||||
#include "stm32f4xx.h" // Device header
|
||||
|
||||
#include "etl/function.h"
|
||||
#include "etl/callback_timer.h"
|
||||
@ -124,6 +128,12 @@ int main()
|
||||
LED_Initialize();
|
||||
Buttons_Initialize();
|
||||
|
||||
long int v = __cplusplus;
|
||||
|
||||
char16_t c16;
|
||||
|
||||
int* p = nullptr;
|
||||
|
||||
// The LEDs will start flashing fast after 2 seconds.
|
||||
// After another 5 seconds they will start flashing slower.
|
||||
short_toggle = callback_timer.register_timer(LedToggle, 50, etl::timer::mode::REPEATING);
|
||||
|
||||
@ -37,7 +37,7 @@ SOFTWARE.
|
||||
/// A definition of nullptr for compilers that don't support it as standard.
|
||||
///\ingroup utilities
|
||||
|
||||
#if (ETL_NO_NULLPTR_SUPPORT && !defined(ARDUINO))
|
||||
#if (ETL_NO_NULLPTR_SUPPORT && !defined(ARDUINO)) || defined(ETL_COMPILER_ARM5)
|
||||
namespace std
|
||||
{
|
||||
//*****************************************************************************
|
||||
@ -73,7 +73,7 @@ namespace std
|
||||
/// A null pointer.
|
||||
///\ingroup nullptr
|
||||
//*****************************************************************************
|
||||
#if !defined(ETL_STLPORT) || !defined(ETL_COMPILER_ARM5)
|
||||
#if !defined(ETL_STLPORT) && (defined(ETL_COMPILER_ARM5) && (__cplusplus < 201103L))
|
||||
const std::nullptr_t nullptr = {};
|
||||
#endif
|
||||
|
||||
|
||||
@ -41,8 +41,8 @@ SOFTWARE.
|
||||
#define ETL_CPP11_SUPPORTED 0
|
||||
#define ETL_CPP14_SUPPORTED 0
|
||||
#define ETL_CPP17_SUPPORTED 0
|
||||
#define ETL_NO_NULLPTR_SUPPORT 1
|
||||
#define ETL_NO_LARGE_CHAR_SUPPORT 1
|
||||
#define ETL_NO_NULLPTR_SUPPORT (__cplusplus < 201103L)
|
||||
#define ETL_NO_LARGE_CHAR_SUPPORT (__cplusplus < 201103L)
|
||||
#define ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED 0
|
||||
|
||||
#endif
|
||||
|
||||
@ -41,8 +41,8 @@ SOFTWARE.
|
||||
#define ETL_CPP11_SUPPORTED 0
|
||||
#define ETL_CPP14_SUPPORTED 0
|
||||
#define ETL_CPP17_SUPPORTED 0
|
||||
#define ETL_NO_NULLPTR_SUPPORT 1
|
||||
#define ETL_NO_LARGE_CHAR_SUPPORT 1
|
||||
#define ETL_NO_NULLPTR_SUPPORT (__cplusplus < 201103L)
|
||||
#define ETL_NO_LARGE_CHAR_SUPPORT (__cplusplus < 201103L)
|
||||
#define ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED 0
|
||||
#define ETL_NO_STL
|
||||
|
||||
|
||||
@ -45,6 +45,7 @@ SOFTWARE.
|
||||
namespace std
|
||||
#endif
|
||||
{
|
||||
#if !defined(ETL_COMPILER_ARM6)
|
||||
//******************************************************************************
|
||||
template <typename T1, typename T2>
|
||||
struct pair
|
||||
@ -90,7 +91,7 @@ SOFTWARE.
|
||||
other.second = temp2;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
//******************************************************************************
|
||||
template <typename T1, typename T2>
|
||||
inline pair<T1, T2> make_pair(T1 a, T2 b)
|
||||
@ -98,6 +99,7 @@ SOFTWARE.
|
||||
return pair<T1, T2>(a, b);
|
||||
}
|
||||
|
||||
#if !defined(ETL_COMPILER_ARM6)
|
||||
//******************************************************************************
|
||||
template <typename T1, typename T2>
|
||||
inline void swap(pair<T1, T2>& a, pair<T1, T2>& b)
|
||||
@ -107,7 +109,7 @@ SOFTWARE.
|
||||
|
||||
//******************************************************************************
|
||||
template <typename T1, typename T2>
|
||||
inline bool operator ==(const pair<T1, T2>& a, const pair<T1, T2>& b)
|
||||
inline bool operator ==(const pair<T1, T2>& a, const pair<T1, T2>& b)
|
||||
{
|
||||
return (a.first == b.first) && (a.second == b.second);
|
||||
}
|
||||
@ -142,6 +144,7 @@ SOFTWARE.
|
||||
{
|
||||
return !(a < b);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user