MCPcopy Create free account
hub / github.com/PricelessToolkit/MailBoxGuard / onReceive

Method onReceive

Code/Arduino_libraries/LoRa/LoRa.cpp:362–378  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

360
361#ifndef ARDUINO_SAMD_MKRWAN1300
362void LoRaClass::onReceive(void(*callback)(int))
363{
364 _onReceive = callback;
365
366 if (callback) {
367 pinMode(_dio0, INPUT);
368#ifdef SPI_HAS_NOTUSINGINTERRUPT
369 SPI.usingInterrupt(digitalPinToInterrupt(_dio0));
370#endif
371 attachInterrupt(digitalPinToInterrupt(_dio0), LoRaClass::onDio0Rise, RISING);
372 } else {
373 detachInterrupt(digitalPinToInterrupt(_dio0));
374#ifdef SPI_HAS_NOTUSINGINTERRUPT
375 SPI.notUsingInterrupt(digitalPinToInterrupt(_dio0));
376#endif
377 }
378}
379
380void LoRaClass::onTxDone(void(*callback)())
381{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected