Author Topic: rfduino lockup when waking with lazarus with pinWakeCallBack pin active low  (Read 488 times)

swangy

  • RFduino Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
so.. anyone else come across this?  simple setup with a pushbutton on pin 3 with a pullup resistor holding the pin HIGH.  the callback function is triggered on active low

when i connect with the bluetooth app and send it *anything* the rfduino just crashes and locks up...   the serial port just starts typing out "BLE Received Buffer data"  but never makes it past the first few characters.. and stops responding until i reset the device..

if i flip the button so that it's resting LOW and swap the code to RFduino_pinWakeCallback(BUTTON_PIN, HIGH.. it works without crashing.   wtf?

any ideas?

Code: [Select]
#include <RFduinoBLE.h>
#include <Lazarus.h>
#define BUTTON_PIN 3

Lazarus Lazarus;

void setup()
{
  Serial.begin(9600);

  RFduinoBLE.begin();
  RFduino_pinWakeCallback(BUTTON_PIN, LOW, onInterrupt);  //callback function for alarm interrupt!
}

void loop()
{
  RFduino_ULPDelay(INFINITE);
  Serial.println("loop");
}


void RFduinoBLE_onReceive(char *data, int len) {
    Serial.println("BLE Received Buffer data");
    Serial.println(data);
    if (len>=1){
      Serial.println("onreceive triggered");
    }
   
    Lazarus.ariseLazarus();
}

int onInterrupt(uint32_t ulPin) {
  Serial.print("** wake ** ");
   
  RFduino_resetPinWake(0);   // resetting the pin puts BLE back to sleep
}

swangy

  • RFduino Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile