Change SQ macro to a constexpr function

This commit is contained in:
Unknown
2020-09-05 00:36:06 -04:00
parent fc5707a1a7
commit 9d5e8614eb
+5 -5
View File
@@ -3,6 +3,7 @@
#include <stdint.h>
#include <limits>
#include <algorithm>
#include <array>
/**
* @brief Flash size register address
@@ -55,11 +56,10 @@
#endif
#define M_PI (3.14159265358979323846f)
#include <array>
#define SQ(x) ((x) * (x))
#include <array>
template<typename T>
constexpr T SQ(const T& x){
return x * x;
}
/**
* @brief Small helper to make array with known size