Thomas Morris / Mbed OS PROJ324_Final

Fork of ELEC351_Group_T by Plymouth ELEC351 Group T

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers TIME.hpp Source File

TIME.hpp

00001 /*
00002 This is where we control the Time of the MicroController and the DATA
00003 */
00004 
00005 #ifndef _TIME_HPP_//Header Guards Prevents Multiple includes
00006 #define _TIME_HPP_
00007 //Libraries and header includes
00008 #include "mbed.h"
00009 #include "rtos.h"
00010 #include <string>
00011 #include <iostream>
00012 #include <sstream>
00013 
00014 //Definitions of Parameters according to the UNIX time standard
00015 #define Days_In_Month 30.436875
00016 #define second 1
00017 #define minute 60
00018 #define hour 3600
00019 #define day 86400
00020 #define week 604800
00021 #define month 2629743
00022 #define year 31556926
00023 
00024 int get_current_time();                                 //Returns Current time
00025 void set_new_date(int days, int months, int years);     //Sets the day,month and year
00026 void set_new_time(int hours, int minutes, int seconds); //Sets the hour, minute and seconds
00027 void Add_Second();                                      //Adds a seconds to time
00028 void Subtract_Second();                                 //Subtracts a second from time
00029 void Add_Minute();                                      //Add a minute to time
00030 void Subtract_Minute();                                 //Subtracts a minute from time
00031 void Add_Hour();                                        //Adds an hour to time
00032 void Subtract_Hour();                                   //Subtracts an hour from time
00033 void Add_Day();                                         //Add a day to time
00034 void Subtract_Day();                                    //Subtracts a day from time
00035 void Add_Month();                                       //Adds a month to time
00036 void Subtract_Month();                                  //Subtracts a month to time
00037 void Add_Year();                                        //Add a year to time
00038 void Subtract_Year();                                   //Subtracts a year from time
00039 
00040 #endif