![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Proj 324 Final
Fork of ELEC351_Group_T by
TIME.hpp
- Committer:
- thomasmorris
- Date:
- 2018-01-06
- Revision:
- 30:4cde05cc7c4f
- Child:
- 31:4a88bf97b53e
File content as of revision 30:4cde05cc7c4f:
#ifndef _TIME_HPP_ //Known as header guards #define _TIME_HPP_ #include "mbed.h" #include "rtos.h" int current_time_global = 0; int new_time = 0; int get_current_time() { current_time_global = time(0); return current_time_global; } //Time File //Seconds to Seconds void Add_Second() { new_time = time(0) + 1; set_time(new_time); } void Subtract_Second() { new_time = time(0) - 1; set_time(new_time); } //Minutes to Seconds void Add_Minute() { new_time = time(0) + 60; set_time(new_time); } void Subtract_Minute() { new_time = time(0) - 60; set_time(new_time); } //Hours to Seconds void Add_hour() { new_time = time(0) + 3600; set_time(new_time); } void Subtract_hour() { new_time = time(0) - 3600; set_time(new_time); } //Days to Seconds void Add_Day() { new_time = time(0) - 86400; set_time(new_time); } void Subtract_Day() { new_time = time(0) - 86400; set_time(new_time); } //Months to Seconds void Add_Month() { new_time = time(0) + 2629743; set_time(new_time); } void Subtract_Month() { new_time = time(0) - 2629743; set_time(new_time); } //Years void Add_Year() { new_time = time(0) + 31556926; set_time(new_time); } void Subtract_Year() { new_time = time(0) + 31556926; set_time(new_time); } #endif