Author Topic: RFduino_pinWakeCallback BUG  (Read 163 times)

swangy

  • RFduino Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
RFduino_pinWakeCallback BUG
« on: February 20, 2017, 02:44:00 PM »
so i have one BUTTON_PIN interrupt that sits LOW and goes HIGH when active
and a second ALARM_PIN interrupt that sits HIGH and goes LOW when active

using the simple code  below, BOTH functions fire when i active only the BUTTON_PIN interrupt... can anyone else confirm this bug or clarify what i'm doing wrong?  thanks!

Code: [Select]

#include <RFduinoBLE.h>

#define BUTTON_PIN 3
#define ALARM_PIN 2

void setup() {

  Serial.begin(9600);
 
  pinMode(BUTTON_PIN,INPUT); 
  pinMode(ALARM_PIN,INPUT); 

  RFduinoBLE.begin();
  RFduino_pinWakeCallback(BUTTON_PIN, HIGH, onButtonPush);   
  RFduino_pinWakeCallback(ALARM_PIN, LOW, onAlarm);   
}

void loop() {
   RFduinoBLE_ULPDelay(INFINITE);
}


int onButtonPush(uint32_t ulPin) {   
  Serial.print("button pushed pin "); 
  Serial.println(ulPin);
   
  RFduino_resetPinWake(BUTTON_PIN);   // resetting the pin puts BLE back to sleep   
  return 1;
}


int onAlarm(uint32_t ulPin) {
  Serial.print(" alarm fired pin ");
  Serial.println(ulPin);

  RFduino_resetPinWake(ALARM_PIN);   // resetting the pin puts BLE back to sleep
 
  return 1;
}


 

anything