Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: 4DGL-uLCD-SE EthernetInterface NTPClient mbed-rtos mbed SDFileSystem wavfile
Diff: Clock.h
- Revision:
- 2:c939d0501184
- Parent:
- 0:4e6ae21cbd31
diff -r c47a2f0816bb -r c939d0501184 Clock.h
--- a/Clock.h Mon Dec 08 10:06:35 2014 +0000
+++ b/Clock.h Mon Dec 08 23:30:49 2014 +0000
@@ -1,4 +1,5 @@
#include "mbed.h"
+#include "rtos.h"
#include "NTPClient.h"
// AM/PM
@@ -15,16 +16,27 @@
class Clock {
public:
Clock();
+ void setAlarmThread(Thread *aThread);
void setTime(int hour, int minute, int period);
void setTimezone(int timezone);
int syncTime();
+ void setAlarm(int hour, int minute, int period);
+ void setTimer(int hours, int minutes);
+ void deleteAlarm();
+ bool alarmSet();
+
time_t getTime();
int getTimezone();
-private:
- int timezone;
- static bool isSet;
+
+private:
+ int timezone;
+ bool aSet;
+ Ticker alarmTicker;
+ Thread *alarmThread;
+
+ void signalAlarm();
};