Use mysensors built-in nrf24 library for RPi

This commit is contained in:
Marcelo Aquino
2016-09-14 23:26:12 -03:00
parent 4175a5f423
commit fab2112f9b
22 changed files with 4051 additions and 544 deletions
+10 -1
View File
@@ -13,6 +13,11 @@
#include <algorithm>
#include "stdlib_noniso.h"
#ifdef LINUX_ARCH_RASPBERRYPI
#include "rpi_util.h"
using namespace rpi_util;
#endif
#define PI 3.1415926535897932384626433832795
#define HALF_PI 1.5707963267948966192313216916398
#define TWO_PI 6.283185307179586476925286766559
@@ -39,6 +44,10 @@
#define GET_MACRO(_0, _1, _2, NAME, ...) NAME
#define random(...) GET_MACRO(_0, ##__VA_ARGS__, randMinMax, randMax, rand)(__VA_ARGS__)
#ifndef delay
#define delay _delay_ms
#endif
using std::string;
using std::min;
using std::max;
@@ -50,7 +59,7 @@ typedef string String;
void yield(void);
unsigned long millis(void);
void delay(unsigned int millis);
void _delay_ms(unsigned int millis);
void randomSeed(unsigned long seed);
long randMax(long howbig);
long randMinMax(long howsmall, long howbig);
+1 -1
View File
@@ -21,7 +21,7 @@ unsigned long millis(void)
return ((curTime.tv_sec - millis_at_start) * 1000) + (curTime.tv_usec / 1000);
}
void delay(unsigned int millis)
void _delay_ms(unsigned int millis)
{
struct timespec sleeper;
+8
View File
@@ -4,7 +4,15 @@
#include <stdarg.h>
#include <syslog.h>
#ifdef __cplusplus
extern "C" {
#endif
extern void mys_log_v(int level, const char *fmt, va_list args);
extern void mys_log(int level, const char *fmt, ...) __attribute__((format(printf,2,3)));
#ifdef __cplusplus
}
#endif
#endif