From aec150f747f3deefe63f8b7f71a11d9b1e9eec09 Mon Sep 17 00:00:00 2001 From: Felix Rusu Date: Tue, 3 Mar 2020 22:57:06 -0500 Subject: [PATCH] 1.4.0 changeset --- Examples/Gateway/Gateway.ino | 4 ---- Examples/Node/Node.ino | 4 ---- Examples/Struct_receive/Struct_receive.ino | 4 ---- Examples/Struct_send/Struct_send.ino | 4 ---- Examples/WeatherNode/WeatherNode.ino | 3 --- RFM69.cpp | 5 ++--- RFM69_ATC.cpp | 3 +-- RFM69_OTA.cpp | 21 +++++++++------------ library.properties | 2 +- 9 files changed, 13 insertions(+), 37 deletions(-) diff --git a/Examples/Gateway/Gateway.ino b/Examples/Gateway/Gateway.ino index f5925ed..cd2f532 100644 --- a/Examples/Gateway/Gateway.ino +++ b/Examples/Gateway/Gateway.ino @@ -65,10 +65,6 @@ //********************************************************************************************* #define SERIAL_BAUD 115200 -#if defined (MOTEINO_M0) && defined(SERIAL_PORT_USBVIRTUAL) - #define Serial SERIAL_PORT_USBVIRTUAL // Required for Serial on Zero based boards -#endif - #ifdef ENABLE_ATC RFM69_ATC radio; #else diff --git a/Examples/Node/Node.ino b/Examples/Node/Node.ino index 190c21f..1d2342d 100644 --- a/Examples/Node/Node.ino +++ b/Examples/Node/Node.ino @@ -64,10 +64,6 @@ //********************************************************************************************* #define SERIAL_BAUD 115200 -#if defined (MOTEINO_M0) && defined(SERIAL_PORT_USBVIRTUAL) - #define Serial SERIAL_PORT_USBVIRTUAL // Required for Serial on Zero based boards -#endif - int TRANSMITPERIOD = 200; //transmit a packet to gateway so often (in ms) char payload[] = "123 ABCDEFGHIJKLMNOPQRSTUVWXYZ"; char buff[20]; diff --git a/Examples/Struct_receive/Struct_receive.ino b/Examples/Struct_receive/Struct_receive.ino index 04cd4b6..eb4afef 100644 --- a/Examples/Struct_receive/Struct_receive.ino +++ b/Examples/Struct_receive/Struct_receive.ino @@ -48,10 +48,6 @@ //********************************************************************************************* #define SERIAL_BAUD 115200 -#if defined (MOTEINO_M0) && defined(SERIAL_PORT_USBVIRTUAL) - #define Serial SERIAL_PORT_USBVIRTUAL // Required for Serial on Zero based boards -#endif - #ifdef ENABLE_ATC RFM69_ATC radio; #else diff --git a/Examples/Struct_send/Struct_send.ino b/Examples/Struct_send/Struct_send.ino index 6315296..e8668c1 100644 --- a/Examples/Struct_send/Struct_send.ino +++ b/Examples/Struct_send/Struct_send.ino @@ -49,10 +49,6 @@ //********************************************************************************************* #define SERIAL_BAUD 115200 -#if defined (MOTEINO_M0) && defined(SERIAL_PORT_USBVIRTUAL) - #define Serial SERIAL_PORT_USBVIRTUAL // Required for Serial on Zero based boards -#endif - #ifdef ENABLE_ATC RFM69_ATC radio; #else diff --git a/Examples/WeatherNode/WeatherNode.ino b/Examples/WeatherNode/WeatherNode.ino index 200b3f5..b01da3d 100644 --- a/Examples/WeatherNode/WeatherNode.ino +++ b/Examples/WeatherNode/WeatherNode.ino @@ -62,9 +62,6 @@ period_t sleepTime = SLEEP_LONGEST; //period_t is an enum type defined in the LowPower library (LowPower.h) //********************************************************************************************* #if defined (MOTEINO_M0) - #if defined(SERIAL_PORT_USBVIRTUAL) - #define Serial SERIAL_PORT_USBVIRTUAL // Required for Serial on Zero based boards - #endif #include #define BATT_MONITOR A5 //through 1Meg+1Megohm and 0.1uF cap from battery VCC - this ratio divides the voltage to bring it below 3.3V where it is scaled to a readable range #define BATT_FORMULA(reading) reading * 0.00322 * 2 // >>> fine tune this parameter to match your voltage when fully charged diff --git a/RFM69.cpp b/RFM69.cpp index 3c55db8..ebbc882 100644 --- a/RFM69.cpp +++ b/RFM69.cpp @@ -25,7 +25,6 @@ // ********************************************************************************** #include "RFM69.h" #include "RFM69registers.h" - #include uint8_t RFM69::DATA[RF69_MAX_DATA_LEN+1]; @@ -329,7 +328,7 @@ void RFM69::sendFrame(uint16_t toAddress, const void* buffer, uint8_t bufferSize // no need to wait for transmit mode to be ready since its handled by the radio setMode(RF69_MODE_TX); - uint32_t txStart = millis(); + //uint32_t txStart = millis(); //while (digitalRead(_interruptPin) == 0 && millis() - txStart < RF69_TX_LIMIT_MS); // wait for DIO0 to turn HIGH signalling transmission finish while ((readReg(REG_IRQFLAGS2) & RF_IRQFLAGS2_PACKETSENT) == 0x00); // wait for PacketSent setMode(RF69_MODE_STANDBY); @@ -960,7 +959,7 @@ void RFM69::listenModeReset(void) //============================================================================= // irq handler, simply calls listenModeInterruptHandler method so internal methods can be accessed easily //============================================================================= -void RFM69::listenModeIrq() { selfPointer->listenModeInterruptHandler(); } +ISR_PREFIX void RFM69::listenModeIrq() { selfPointer->listenModeInterruptHandler(); } //============================================================================= // listenModeInterruptHandler() - only called by listen irq handler diff --git a/RFM69_ATC.cpp b/RFM69_ATC.cpp index 9425311..4530441 100644 --- a/RFM69_ATC.cpp +++ b/RFM69_ATC.cpp @@ -29,7 +29,6 @@ #include "RFM69_ATC.h" #include "RFM69.h" // include the RFM69 library files as well #include "RFM69registers.h" - #include volatile uint8_t RFM69_ATC::ACK_RSSI_REQUESTED; // new type of flag on ACK_REQUEST @@ -127,7 +126,7 @@ void RFM69_ATC::sendFrame(uint16_t toAddress, const void* buffer, uint8_t buffer // no need to wait for transmit mode to be ready since its handled by the radio setMode(RF69_MODE_TX); - uint32_t txStart = millis(); + //uint32_t txStart = millis(); //while (digitalRead(_interruptPin) == 0 && millis() - txStart < RF69_TX_LIMIT_MS); // wait for DIO0 to turn HIGH signalling transmission finish while ((readReg(REG_IRQFLAGS2) & RF_IRQFLAGS2_PACKETSENT) == 0x00); // wait for PacketSent setMode(RF69_MODE_STANDBY); diff --git a/RFM69_OTA.cpp b/RFM69_OTA.cpp index d30a0bf..5a7c8a6 100644 --- a/RFM69_OTA.cpp +++ b/RFM69_OTA.cpp @@ -37,11 +37,6 @@ #include #endif -#ifdef MOTEINO_M0 - #if defined(SERIAL_PORT_USBVIRTUAL) - #define Serial SERIAL_PORT_USBVIRTUAL // output on SerialUSB instead of Serial - #endif -#endif //=================================================================================================================== // CheckForWirelessHEX() - Checks whether the last message received was a wireless programming request handshake // If so it will start the handshake protocol, receive the new HEX image and @@ -546,12 +541,14 @@ void resetUsingWatchdog(uint8_t DEBUG) wdt_enable(WDTO_15MS); while(1) if (DEBUG) Serial.print(F(".")); #elif defined(MOTEINO_M0) - WDT->CTRL.reg = 0; // disable watchdog - while (WDT->STATUS.bit.SYNCBUSY == 1); // sync is required - WDT->CONFIG.reg = 0; // see Table 18.8.2 Timeout Period (valid values 0-11) - WDT->CTRL.reg = WDT_CTRL_ENABLE; //enable WDT - while (WDT->STATUS.bit.SYNCBUSY == 1); - WDT->CLEAR.reg= 0x00; // system reset via WDT - while (WDT->STATUS.bit.SYNCBUSY == 1); + //WDT->CTRL.reg = 0; // disable watchdog + //while (WDT->STATUS.bit.SYNCBUSY == 1); // sync is required + //WDT->CONFIG.reg = 0; // see Table 18.8.2 Timeout Period (valid values 0-11) + //WDT->CTRL.reg = WDT_CTRL_ENABLE; //enable WDT + //while (WDT->STATUS.bit.SYNCBUSY == 1); + //WDT->CLEAR.reg= 0x00; // system reset via WDT + //while (WDT->STATUS.bit.SYNCBUSY == 1); + *((volatile uint32_t *)(HMCRAMC0_ADDR + HMCRAMC0_SIZE - 4)) = 0xF1A507AF; + NVIC_SystemReset(); #endif } \ No newline at end of file diff --git a/library.properties b/library.properties index 6b5aaa2..a89f973 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=RFM69_LowPowerLab -version=1.3.0 +version=1.4.0 author=LowPowerLab maintainer=Felix Rusu sentence=Simple Arduino library for RFM69/SX1231h based radio module transceivers