NRF5: Updates for Jenkins verifier (#852)

This commit is contained in:
Olivier
2017-05-21 08:41:11 +02:00
committed by GitHub
parent 6e648f58da
commit e041bf4d74
6 changed files with 24 additions and 16 deletions
+6
View File
@@ -76,6 +76,12 @@
// transport layer files // transport layer files
#define debug(x,...) DEBUG_OUTPUT(x, ##__VA_ARGS__) //!< debug #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 // 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) #if defined(MY_RADIO_RF24) || defined(MY_RADIO_NRF5_ESB) || defined(MY_RADIO_RFM69) || defined(MY_RADIO_RFM95) || defined(MY_RS485)
+1 -2
View File
@@ -1,4 +1,4 @@
/** /**
* The MySensors Arduino library handles the wireless radio link and protocol * The MySensors Arduino library handles the wireless radio link and protocol
* between your home built sensors/actuators and HA controller of choice. * between your home built sensors/actuators and HA controller of choice.
* The sensors forms a self healing radio network with optional repeaters. Each * The sensors forms a self healing radio network with optional repeaters. Each
@@ -82,7 +82,6 @@ bool protocolParse(MyMessage &message, char *inputString)
} }
i++; i++;
} }
//debug(PSTR("Received %d"), i);
// Check for invalid input // Check for invalid input
if (i < 5) { if (i < 5) {
return false; return false;
+3 -3
View File
@@ -1,4 +1,4 @@
/** /**
* The MySensors Arduino library handles the wireless radio link and protocol * The MySensors Arduino library handles the wireless radio link and protocol
* between your home built sensors/actuators and HA controller of choice. * between your home built sensors/actuators and HA controller of choice.
@@ -43,9 +43,9 @@
// debug // debug
#if defined(MY_DEBUG_VERBOSE_NRF5_ESB) #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 #else
#define NRF5_RADIO_DEBUG(x, ...) #define NRF5_RADIO_DEBUG(x, ...) //!< DEBUG null
#endif #endif
// tx power // tx power
+6 -6
View File
@@ -71,14 +71,14 @@
#include <MySensors.h> #include <MySensors.h>
// Setting up format for reading 3 soil sensors // 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 #define CHILD_ID 0
MyMessage msg(CHILD_ID, V_LEVEL); MyMessage msg(CHILD_ID, V_LEVEL);
unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds) unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds)
long buffer[NUM_READS]; 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) /// @brief Structure to be used in percentage and resistance values matrix to be filtered (have to be in pairs)
typedef struct { typedef struct {
@@ -179,10 +179,10 @@ void measure (int phase_b, int phase_a, int analog_input)
// Averaging algorithm // Averaging algorithm
void addReading(long resistance) void addReading(long resistance)
{ {
buffer[index] = resistance; buffer[idx] = resistance;
index++; idx++;
if (index >= NUM_READS) { if (idx >= NUM_READS) {
index = 0; idx = 0;
} }
} }
+2 -2
View File
@@ -1,4 +1,4 @@
/** /**
* The MySensors Arduino library handles the wireless radio link and protocol * The MySensors Arduino library handles the wireless radio link and protocol
* between your home built sensors/actuators and HA controller of choice. * between your home built sensors/actuators and HA controller of choice.
* The sensors forms a self healing radio network with optional repeaters. Each * 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! // already be handled!
MY_CRITICAL_SECTION { MY_CRITICAL_SECTION {
// Fix cppcheck "(style) Variable '__savePriMask' is assigned a value that is never used." // Fix cppcheck "(style) Variable '__savePriMask' is assigned a value that is never used."
(void)__savePriMask; //(void)__savePriMask;
// attach interrupts // attach interrupts
_wakeUp1Interrupt = interrupt1; _wakeUp1Interrupt = interrupt1;
_wakeUp2Interrupt = interrupt2; _wakeUp2Interrupt = interrupt2;
+5 -2
View File
@@ -1,4 +1,4 @@
/** /**
* The MySensors Arduino library handles the wireless radio link and protocol * The MySensors Arduino library handles the wireless radio link and protocol
* between your home built sensors/actuators and HA controller of choice. * between your home built sensors/actuators and HA controller of choice.
* The sensors forms a self healing radio network with optional repeaters. Each * The sensors forms a self healing radio network with optional repeaters. Each
@@ -43,6 +43,7 @@
#include <nrf.h> #include <nrf.h>
#define snprintf_P(s, f, ...) snprintf((s), (f), __VA_ARGS__) #define snprintf_P(s, f, ...) snprintf((s), (f), __VA_ARGS__)
#define printf_P printf
// Define these as macros to save valuable space // Define these as macros to save valuable space
#define hwDigitalWrite(__pin, __value) digitalWrite(__pin, __value) #define hwDigitalWrite(__pin, __value) digitalWrite(__pin, __value)
@@ -110,7 +111,9 @@ static __inline__ void __priMaskRestore(const uint32_t *priMask)
#endif #endif
#ifndef DOXYGEN #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 \ for (uint32_t __savePriMask \
__attribute__((__cleanup__(__priMaskRestore))) = __get_PRIMASK(), \ __attribute__((__cleanup__(__priMaskRestore))) = __get_PRIMASK(), \
__ToDo = __disableIntsRetVal(); \ __ToDo = __disableIntsRetVal(); \