Skip to content

Commit

Permalink
1.4.0 changeset
Browse files Browse the repository at this point in the history
  • Loading branch information
LowPowerLab committed Mar 4, 2020
1 parent 7008d57 commit aec150f
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 37 deletions.
4 changes: 0 additions & 4 deletions Examples/Gateway/Gateway.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions Examples/Node/Node.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
4 changes: 0 additions & 4 deletions Examples/Struct_receive/Struct_receive.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions Examples/Struct_send/Struct_send.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions Examples/WeatherNode/WeatherNode.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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 <avr/dtostrf.h>
#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
Expand Down
5 changes: 2 additions & 3 deletions RFM69.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
// **********************************************************************************
#include "RFM69.h"
#include "RFM69registers.h"

#include <SPI.h>

uint8_t RFM69::DATA[RF69_MAX_DATA_LEN+1];
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions RFM69_ATC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include "RFM69_ATC.h"
#include "RFM69.h" // include the RFM69 library files as well
#include "RFM69registers.h"

#include <SPI.h>

volatile uint8_t RFM69_ATC::ACK_RSSI_REQUESTED; // new type of flag on ACK_REQUEST
Expand Down Expand Up @@ -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);
Expand Down
21 changes: 9 additions & 12 deletions RFM69_OTA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@
#include <avr/wdt.h>
#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
Expand Down Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=RFM69_LowPowerLab
version=1.3.0
version=1.4.0
author=LowPowerLab <lowpowerlab.com>
maintainer=Felix Rusu <[email protected]>
sentence=Simple Arduino library for RFM69/SX1231h based radio module transceivers
Expand Down

0 comments on commit aec150f

Please sign in to comment.