1.4.0 changeset

This commit is contained in:
Felix Rusu 2020-03-03 22:57:06 -05:00
parent 7008d57a60
commit aec150f747
9 changed files with 13 additions and 37 deletions

View File

@ -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

View File

@ -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];

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -25,7 +25,6 @@
// **********************************************************************************
#include "RFM69.h"
#include "RFM69registers.h"
#include <SPI.h>
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

View File

@ -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
@ -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);

View File

@ -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
@ -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
}

View File

@ -1,5 +1,5 @@
name=RFM69_LowPowerLab
version=1.3.0
version=1.4.0
author=LowPowerLab <lowpowerlab.com>
maintainer=Felix Rusu <felix@lowpowerlab.com>
sentence=Simple Arduino library for RFM69/SX1231h based radio module transceivers