Skip to content

Commit 629ab0f

Browse files
author
Jack Christensen
committed
Added (uint8_t) casts to i2cWrite() calls for Arduino 1.0 compatibility.
Changed example sketches to have .pde file extentions for pre-1.0 compatibility.
1 parent 3a88bef commit 629ab0f

File tree

7 files changed

+6
-6
lines changed

7 files changed

+6
-6
lines changed
File renamed without changes.

MCP79412RTC.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ void MCP79412RTC::set(time_t t)
6464
boolean MCP79412RTC::read(tmElements_t &tm)
6565
{
6666
Wire.beginTransmission(RTC_ADDR);
67-
i2cWrite(TIME_REG);
67+
i2cWrite((uint8_t)TIME_REG);
6868
if (Wire.endTransmission() != 0) {
6969
return false;
7070
}
@@ -88,8 +88,8 @@ boolean MCP79412RTC::read(tmElements_t &tm)
8888
void MCP79412RTC::write(tmElements_t &tm)
8989
{
9090
Wire.beginTransmission(RTC_ADDR);
91-
i2cWrite(TIME_REG);
92-
i2cWrite(0x00); //stops the oscillator (Bit 7, ST == 0)
91+
i2cWrite((uint8_t)TIME_REG);
92+
i2cWrite((uint8_t)0x00); //stops the oscillator (Bit 7, ST == 0)
9393
i2cWrite(dec2bcd(tm.Minute));
9494
i2cWrite(dec2bcd(tm.Hour)); //sets 24 hour format (Bit 6 == 0)
9595
i2cWrite(tm.Wday | _BV(VBATEN)); //enable battery backup operation
@@ -99,7 +99,7 @@ void MCP79412RTC::write(tmElements_t &tm)
9999
Wire.endTransmission();
100100

101101
Wire.beginTransmission(RTC_ADDR);
102-
i2cWrite(TIME_REG);
102+
i2cWrite((uint8_t)TIME_REG);
103103
i2cWrite(dec2bcd(tm.Second) | _BV(ST)); //set the seconds and start the oscillator (Bit 7, ST == 1)
104104
Wire.endTransmission();
105105
}
@@ -284,7 +284,7 @@ byte MCP79412RTC::eepromWait(void)
284284
{
285285
++waitCount;
286286
Wire.beginTransmission(EEPROM_ADDR);
287-
i2cWrite(0);
287+
i2cWrite((uint8_t)0);
288288
txStatus = Wire.endTransmission();
289289

290290
} while (txStatus != 0);
@@ -537,7 +537,7 @@ void MCP79412RTC::alarmPolarity(boolean polarity)
537537
boolean MCP79412RTC::isRunning(void)
538538
{
539539
Wire.beginTransmission(RTC_ADDR);
540-
i2cWrite(TIME_REG);
540+
i2cWrite((uint8_t)TIME_REG);
541541
Wire.endTransmission();
542542

543543
//request just the seconds register

0 commit comments

Comments
 (0)