define PIP_MICRO
detect AVR_GCC add library.json
This commit is contained in:
@@ -28,10 +28,12 @@
|
||||
|
||||
#include "picout.h"
|
||||
#include "piintrospection_containers.h"
|
||||
#ifdef MAC_OS
|
||||
# include <stdlib.h>
|
||||
#else
|
||||
# include <malloc.h>
|
||||
#ifndef PIP_MICRO
|
||||
# ifdef MAC_OS
|
||||
# include <stdlib.h>
|
||||
# else
|
||||
# include <malloc.h>
|
||||
# endif
|
||||
#endif
|
||||
#include <initializer_list>
|
||||
#include <type_traits>
|
||||
|
||||
@@ -31,8 +31,6 @@
|
||||
#include "pip_export.h"
|
||||
#include "pip_defs.h"
|
||||
#include "string.h"
|
||||
#include <limits>
|
||||
|
||||
//! Meta-information section for any entity.
|
||||
//! Parsing by \a pip_cmg and can be accessed by \a PICodeInfo.
|
||||
//! Contains sequence of key=value pairs, e.g.
|
||||
@@ -119,9 +117,14 @@
|
||||
|
||||
#endif //DOXYGEN
|
||||
|
||||
#ifdef CC_AVR_GCC
|
||||
# include <ArduinoSTL.h>
|
||||
#endif
|
||||
#include <functional>
|
||||
|
||||
#include <cstddef>
|
||||
#include <cassert>
|
||||
#include <limits>
|
||||
|
||||
#ifdef WINDOWS
|
||||
# ifdef CC_VC
|
||||
# define SHUT_RDWR 2
|
||||
@@ -162,7 +165,6 @@
|
||||
#ifdef NDEBUG
|
||||
# undef NDEBUG
|
||||
#endif
|
||||
#include <cassert>
|
||||
#ifndef assert
|
||||
# define assert(x)
|
||||
# define assertm(exp, msg)
|
||||
@@ -364,7 +366,7 @@ inline bool piCompareBinary(const void * f, const void * s, size_t size) {
|
||||
*/
|
||||
template<typename T>
|
||||
inline bool piCompare(const T & a, const T & b, const T & epsilon = std::numeric_limits<T>::epsilon()) {
|
||||
return std::abs(a - b) <= epsilon;
|
||||
return piAbs(a - b) <= epsilon;
|
||||
}
|
||||
|
||||
/*! @brief Templated function return round of float falue
|
||||
@@ -499,13 +501,13 @@ template<typename T> inline void piLetobe(T * v) {piLetobe(v, sizeof(T));}
|
||||
template<typename T> inline T piLetobe(const T & v) {T tv(v); piLetobe(&tv, sizeof(T)); return tv;}
|
||||
|
||||
// specialization
|
||||
template<> inline ushort piLetobe(const ushort & v) {return (v << 8) | (v >> 8);}
|
||||
template<> inline uint piLetobe(const uint & v) {return (v >> 24) | ((v >> 8) & 0xFF00) | ((v << 8) & 0xFF0000) | ((v << 24) & 0xFF000000);}
|
||||
template<> inline uint16_t piLetobe(const uint16_t & v) {return (v << 8) | (v >> 8);}
|
||||
template<> inline uint32_t piLetobe(const uint32_t & v) {return (v >> 24) | ((v >> 8) & 0xFF00) | ((v << 8) & 0xFF0000) | ((v << 24) & 0xFF000000);}
|
||||
template<> inline float piLetobe(const float & v) {
|
||||
union _pletobe_f {
|
||||
_pletobe_f(const float &f_) {f = f_;}
|
||||
float f;
|
||||
uint v;
|
||||
uint32_t v;
|
||||
};
|
||||
_pletobe_f a(v);
|
||||
a.v = (a.v >> 24) | ((a.v >> 8) & 0xFF00) | ((a.v << 8) & 0xFF0000) | ((a.v << 24) & 0xFF000000);
|
||||
|
||||
@@ -26,8 +26,9 @@
|
||||
#ifdef PIP_STD_IOSTREAM
|
||||
# include <iostream>
|
||||
#endif
|
||||
#include <atomic>
|
||||
|
||||
#ifndef PIP_MICRO
|
||||
# include <atomic>
|
||||
#endif
|
||||
|
||||
class PIMutex;
|
||||
class PIMutexLocker;
|
||||
|
||||
@@ -84,6 +84,10 @@
|
||||
# define CC_OTHER
|
||||
#endif
|
||||
|
||||
#ifdef __AVR__
|
||||
# define CC_AVR_GCC
|
||||
#endif
|
||||
|
||||
#ifdef WINDOWS
|
||||
# ifdef CC_GCC
|
||||
# define typeof __typeof
|
||||
|
||||
Reference in New Issue
Block a user