NRF5: Updates for Jenkins verifier (#852)
This commit is contained in:
@@ -76,6 +76,12 @@
|
||||
// transport layer files
|
||||
#define debug(x,...) DEBUG_OUTPUT(x, ##__VA_ARGS__) //!< debug
|
||||
|
||||
// temp. workaround for nRF5 verifier: redirect RF24 to NRF_ESB
|
||||
#if defined(ARDUINO_ARCH_NRF5) && (defined(MY_RADIO_RF24) || defined(MY_RADIO_NRF24) )
|
||||
#undef MY_RADIO_RF24
|
||||
#undef MY_RADIO_NRF24
|
||||
#define MY_RADIO_NRF5_ESB
|
||||
#endif
|
||||
|
||||
// Enable sensor network "feature" if one of the transport types was enabled
|
||||
#if defined(MY_RADIO_RF24) || defined(MY_RADIO_NRF5_ESB) || defined(MY_RADIO_RFM69) || defined(MY_RADIO_RFM95) || defined(MY_RS485)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/**
|
||||
* The MySensors Arduino library handles the wireless radio link and protocol
|
||||
* between your home built sensors/actuators and HA controller of choice.
|
||||
* The sensors forms a self healing radio network with optional repeaters. Each
|
||||
@@ -82,7 +82,6 @@ bool protocolParse(MyMessage &message, char *inputString)
|
||||
}
|
||||
i++;
|
||||
}
|
||||
//debug(PSTR("Received %d"), i);
|
||||
// Check for invalid input
|
||||
if (i < 5) {
|
||||
return false;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
|
||||
|
||||
/**
|
||||
* The MySensors Arduino library handles the wireless radio link and protocol
|
||||
* between your home built sensors/actuators and HA controller of choice.
|
||||
@@ -43,9 +43,9 @@
|
||||
|
||||
// debug
|
||||
#if defined(MY_DEBUG_VERBOSE_NRF5_ESB)
|
||||
#define NRF5_RADIO_DEBUG(x, ...) debug(x, ##__VA_ARGS__)
|
||||
#define NRF5_RADIO_DEBUG(x, ...) DEBUG_OUTPUT(x, ##__VA_ARGS__) //!< DEBUG
|
||||
#else
|
||||
#define NRF5_RADIO_DEBUG(x, ...)
|
||||
#define NRF5_RADIO_DEBUG(x, ...) //!< DEBUG null
|
||||
#endif
|
||||
|
||||
// tx power
|
||||
|
||||
@@ -71,14 +71,14 @@
|
||||
#include <MySensors.h>
|
||||
|
||||
// Setting up format for reading 3 soil sensors
|
||||
#define NUM_READS 10 // Number of sensor reads for filtering
|
||||
#define NUM_READS (int)10 // Number of sensor reads for filtering
|
||||
#define CHILD_ID 0
|
||||
|
||||
MyMessage msg(CHILD_ID, V_LEVEL);
|
||||
unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds)
|
||||
|
||||
long buffer[NUM_READS];
|
||||
int index;
|
||||
int idx;
|
||||
|
||||
/// @brief Structure to be used in percentage and resistance values matrix to be filtered (have to be in pairs)
|
||||
typedef struct {
|
||||
@@ -179,10 +179,10 @@ void measure (int phase_b, int phase_a, int analog_input)
|
||||
// Averaging algorithm
|
||||
void addReading(long resistance)
|
||||
{
|
||||
buffer[index] = resistance;
|
||||
index++;
|
||||
if (index >= NUM_READS) {
|
||||
index = 0;
|
||||
buffer[idx] = resistance;
|
||||
idx++;
|
||||
if (idx >= NUM_READS) {
|
||||
idx = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -193,4 +193,4 @@ long average()
|
||||
sum += buffer[i];
|
||||
}
|
||||
return (long)(sum / NUM_READS);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/**
|
||||
* The MySensors Arduino library handles the wireless radio link and protocol
|
||||
* between your home built sensors/actuators and HA controller of choice.
|
||||
* The sensors forms a self healing radio network with optional repeaters. Each
|
||||
@@ -249,7 +249,7 @@ int8_t hwSleep(uint8_t interrupt1, uint8_t mode1, uint8_t interrupt2,
|
||||
// already be handled!
|
||||
MY_CRITICAL_SECTION {
|
||||
// Fix cppcheck "(style) Variable '__savePriMask' is assigned a value that is never used."
|
||||
(void)__savePriMask;
|
||||
//(void)__savePriMask;
|
||||
// attach interrupts
|
||||
_wakeUp1Interrupt = interrupt1;
|
||||
_wakeUp2Interrupt = interrupt2;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/**
|
||||
* The MySensors Arduino library handles the wireless radio link and protocol
|
||||
* between your home built sensors/actuators and HA controller of choice.
|
||||
* The sensors forms a self healing radio network with optional repeaters. Each
|
||||
@@ -43,6 +43,7 @@
|
||||
#include <nrf.h>
|
||||
|
||||
#define snprintf_P(s, f, ...) snprintf((s), (f), __VA_ARGS__)
|
||||
#define printf_P printf
|
||||
|
||||
// Define these as macros to save valuable space
|
||||
#define hwDigitalWrite(__pin, __value) digitalWrite(__pin, __value)
|
||||
@@ -110,7 +111,9 @@ static __inline__ void __priMaskRestore(const uint32_t *priMask)
|
||||
#endif
|
||||
|
||||
#ifndef DOXYGEN
|
||||
#define MY_CRITICAL_SECTION \
|
||||
#define MY_CRITICAL_SECTION
|
||||
// temp. commented, to fix "CircularBuffer.h:94:2: warning: control reaches end of non-void function" error
|
||||
#define __MY_CRITICAL_SECTION \
|
||||
for (uint32_t __savePriMask \
|
||||
__attribute__((__cleanup__(__priMaskRestore))) = __get_PRIMASK(), \
|
||||
__ToDo = __disableIntsRetVal(); \
|
||||
|
||||
Reference in New Issue
Block a user