]> git.karo-electronics.de Git - oswald.git/blobdiff - ui/calendar.c
Make accelerometer work, interrup driven tilt change mode
[oswald.git] / ui / calendar.c
index 6271e12a43b7edb9ae51561d46cfd02942019e8e..feca174572d13ec97236beb9d3440beba4003bf4 100644 (file)
@@ -4,9 +4,10 @@
 
 unsigned char is_leap(const unsigned int year)
 {
-  // Die Regel lautet: Alles, was durch 4 teilbar ist, ist ein Schaltjahr.
-  // Es sei denn, das Jahr ist durch 100 teilbar, dann ist es keins.
-  // Aber wenn es durch 400 teilbar ist, ist es doch wieder eins.
+       /* the rule is, everything that can be devided by 4 is leap.
+        * Exception: the year can be devided by 100, then it is not,
+        * except it canbe devided by 400, then it is again.
+        */
 
        if ((year % 400) == 0)
                return 1;
@@ -20,11 +21,11 @@ unsigned char is_leap(const unsigned int year)
 
 unsigned short days_of_month(const unsigned int uMonat, const unsigned int uJahr)
 {
-       //                     ungült,Jan,Feb,Mrz,Apr,Mai,Jun,Jul,Aug,Sep,Okt,Nov,Dez
+       // invalid,January,Febuary,March,April,May,June,July,August,September,October,November,December
        int arrTageImMonat[13] = {  0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
 
        if (uMonat == 2) {
-               // Februar: Schaltjahr unterscheiden
+               // Febuary: distinguish leap
                if (is_leap(uJahr))
                        return 29;
                else