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.
Fork of timer0 by
Revision 2:f63678f5ed05, committed 2016-03-10
- Comitter:
- rs27
- Date:
- Thu Mar 10 20:34:59 2016 +0000
- Parent:
- 1:3ab9e5cd87e7
- Commit message:
Changed in this revision
| timer0.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/timer0.cpp Fri Feb 05 14:39:23 2016 +0000
+++ b/timer0.cpp Thu Mar 10 20:34:59 2016 +0000
@@ -52,7 +52,8 @@
seconds++;
set_time(seconds);
- // ----- count down timers in s -------------------------------------------------
+ // ----- count down timers in seconds -------------------------------------------------
+
for (i=0; i<TIMER0_NUM_COUNTDOWNTIMERS; i++)
{
if (CountDownTimers[i].status == 2)
@@ -71,6 +72,20 @@
else
{
sec = 0;
+
+ // ----- count down timers in minuts -------------------------------------------------
+
+ for (i=0; i<TIMER0_NUM_COUNTDOWNTIMERS; i++)
+ {
+ if (CountDownTimers[i].status == 3)
+ { // sekunden
+ if (CountDownTimers[i].count_timer > 0)
+ CountDownTimers[i].count_timer -- ;
+ if (CountDownTimers[i].count_timer == 0)
+ CountDownTimers[i].status = 0;
+ }
+ }
+
if (min < 60) min++;
else
{
