Fork of Ds3231 library that replaces inheritance of I2C class with a private member var of type I2C *

Dependents:   ard2pmod DS3231_Alarm_Demo MAXREFDES130_131_Demo MAXREFDES130_Demo

Fork of ds3231 by Maxim Integrated

Files at this revision

API Documentation at this revision

Comitter:
j3
Date:
Sun Aug 21 01:39:50 2016 +0000
Parent:
15:16ca4c747252
Commit message:
fixed reading of alarm 2 hour parameter

Changed in this revision

ds3231.cpp Show annotated file Show diff for this revision Revisions of this file
ds3231.h Show annotated file Show diff for this revision Revisions of this file
diff -r 16ca4c747252 -r e1c0f63595d9 ds3231.cpp
--- a/ds3231.cpp	Mon Mar 28 19:17:34 2016 +0000
+++ b/ds3231.cpp	Sun Aug 21 01:39:50 2016 +0000
@@ -417,11 +417,11 @@
             
             if(alarm->mode)
             {
-                alarm->hours = bcd_2_uchar((data[2]&0x1F));
+                alarm->hours = bcd_2_uchar((data[1]&0x1F));
             }
             else
             {
-                alarm->hours = bcd_2_uchar((data[2]&0x3F));
+                alarm->hours = bcd_2_uchar((data[1]&0x3F));
             }  
             
             if(data[2] & DY_DT)
diff -r 16ca4c747252 -r e1c0f63595d9 ds3231.h
--- a/ds3231.h	Mon Mar 28 19:17:34 2016 +0000
+++ b/ds3231.h	Sun Aug 21 01:39:50 2016 +0000
@@ -151,7 +151,10 @@
     uint8_t status; 
 }ds3231_cntl_stat_t;
         
-                
+
+/**
+* @brief DS3231 Class
+*/                
 class Ds3231
 {
     public: