Author Topic: micros() and millis() initialize at very high values when BT is on  (Read 1053 times)

squatsandscience

  • RFduino Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
It seems that running RFduinoBLE.begin() causes the micros() and millis() functions to jump to very high numbers. I'm consistently getting 3557034959 microseconds and a similarly high millisecond value. This goes away when I remove bluetooth initialization and occurs regardless of where I put the function into my code. I can easily set my variables to start at 3557034959 rather than zero to track time, but this seems like something that shouldn't be happening outside of my code.

Hoping somebody can duplicate this elsewhere.

tolson

  • Global Moderator
  • *****
  • Posts: 866
  • Karma: +20/-0
    • View Profile
    • Thomas Olson Consulting
Re: micros() and millis() initialize at very high values when BT is on
« Reply #1 on: February 16, 2016, 12:40:02 PM »
Please provide a minimal example showing this phenomena. I don't see it.

Code: [Select]
#include <RFduinoBLE.h>


void setup() {

  Serial.begin(9600);

}

void loop() {

  Serial.println(millis());
  RFduinoBLE.begin();
  Serial.println(millis());
  RFduinoBLE.end();
  delay(1000);
  Serial.println("\n\n\n");
 
}

produces...
0
19




1020
1039




2040
2059

« Last Edit: February 16, 2016, 12:44:35 PM by tolson »