Skip to content

Commit

Permalink
Added sleep function for dev testing on deep sleep.
Browse files Browse the repository at this point in the history
  • Loading branch information
clavisound committed Jul 4, 2024
1 parent cc9a7d2 commit 1eed30a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions SlimLoRa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,11 @@ void SlimLoRa::Begin() {
#endif
}

// TODO this routine resides in some places.
void SlimLoRa::sleep() {
RfmWrite(RFM_REG_OP_MODE, 0x00);
}

// EVAL for accuracy (FAIL: does not compile)
//void wait_until(unsigned long microsstamp) __attribute__((optimize("-Ofast")));
void wait_until(unsigned long microsstamp) {
Expand Down
1 change: 1 addition & 0 deletions SlimLoRa.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ class SlimLoRa {
public:
SlimLoRa(uint8_t pin_nss); // TODO: TinyLoRa rfm_dio0 (7), rfm_nss (8), rfm_rst (4)
void Begin(void);
void sleep(void);
bool HasJoined(void);
int8_t Join();
void SendData(uint8_t fport, uint8_t *payload, uint8_t payload_length);
Expand Down
4 changes: 2 additions & 2 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name=SlimLoRa
version=0.1.5
version=0.1.6
author=novag
maintainer=clavisound
sentence=SlimLoRa Library
paragraph=Basic LoRaWAN library with OTAA and ADR support for EU868. Testes with avr32u4 aka ATmega32u4 and HopeRF 95w (SX1276) on Adafruit Feather. ABP untested. Testers wanted for other regions.
paragraph=Basic LoRaWAN library with OTAA and ADR support for EU868. Tested with avr32u4 aka ATmega32u4 and HopeRF 95w (SX1276) on Adafruit Feather. ABP untested. Testers wanted for other regions.
category=Communication
url=https://github.com/clavisound/SlimLoRa
architectures=*

0 comments on commit 1eed30a

Please sign in to comment.