vigneshkum / rfid-attendance-system

Automatically exported from code.google.com/p/rfid-attendance-system
0 stars 1 forks source link

Unable to Print Time During Initialization. #1

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Description:

Time Method Causes problem in Memory Card Initialization.

When the following code is enabled in the initTime() method, it causes 
memoryInit() method to fail and ARDUINO Hangs!

=================================
void initTime(){
  if(debug){
    Serial.print("initTime() :: ");
  }

  //setTime(hh,mm,ss,DD,MM,YYYY);
  //setTime(02,03,30,25,07,2012);
  setSyncProvider(RTC.get);   // the function to get the time from the RTC
  setSyncInterval(30000);
  if(timeStatus()!= timeSet){ 
    if(debug){
      Serial.println("Unable to sync with the RTC");
    }
    welcomeMsg = "Time not Synced!";
    //Disable the RFID READER
    deviceReady = false;
    //Display("Time not Synced",0);
  }
  else{
    if(debug){
      Serial.println("RTC has set the system time");

//--------------Buggy Code Start------------
      Serial.print("initTime() :: "); 
      Serial.print("System time is = ");      
      time_t t = now();
      Serial.println(t);
//--------------Buggy Code End------------

    }
  }
}
==========================

What steps will reproduce the problem?
1. Enable the code and recompile and upload to Arduino

What is the expected output? 

<==========Device Booted!==========>
setup() :: Now Initializing Dependent Modules and Hardware.
initTime() :: RTC has set the system time
initTime() :: System time is = 1368369590
initMemory() :: Initializing SD card... => Memory Card is Ready.
initRFID() :: Connected to RFID Scanner.
initDisplay() :: LCD Display is ready!
setup() :: All Hardware is OK and Ready to Use.
<==========End of SETUP()==========>

What do you see instead?

<==========Device Booted!==========>
setup() :: Now Initializing Dependent Modules and Hardware.
initTime() :: RTC has set the system time
initTime() :: System time is = 1368369590
initMemory() :: Initializing SD card... => 

{{ Device Hangs after this }}

Original issue reported on code.google.com by vaibhav.shetyeG on 12 May 2013 at 9:20