Skip to content

Commit

Permalink
Fix enum-enum conversion warning in RtcDS1302.h (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
notnullxyz authored Nov 4, 2024
1 parent 778588e commit 4c790ee
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/RtcDS1302.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const uint8_t DS1302RamSize = 31;


// DS1302 Trickle Charge Control Register Bits
enum DS1302TcrResistor
enum DS1302TcrResistor : uint8_t
{
DS1302TcrResistor_Disabled = 0,
DS1302TcrResistor_2KOhm = 0b00000001,
Expand All @@ -53,7 +53,7 @@ enum DS1302TcrResistor
DS1302TcrResistor_MASK = 0b00000011,
};

enum DS1302TcrDiodes
enum DS1302TcrDiodes : uint8_t
{
DS1302TcrDiodes_None = 0,
DS1302TcrDiodes_One = 0b00000100,
Expand All @@ -62,14 +62,16 @@ enum DS1302TcrDiodes
DS1302TcrDiodes_MASK = 0b00001100,
};

enum DS1302TcrStatus
enum DS1302TcrStatus : uint8_t
{
DS1302TcrStatus_Enabled = 0b10100000,
DS1302TcrStatus_Disabled = 0b01010000,
DS1302TcrStatus_MASK = 0b11110000,
};

const uint8_t DS1302Tcr_Disabled = DS1302TcrStatus_Disabled | DS1302TcrDiodes_Disabled | DS1302TcrResistor_Disabled;
const uint8_t DS1302Tcr_Disabled = static_cast<uint8_t>(DS1302TcrStatus_Disabled) |
static_cast<uint8_t>(DS1302TcrDiodes_Disabled) |
static_cast<uint8_t>(DS1302TcrResistor_Disabled);

// DS1302 Clock Halt Register & Bits
const uint8_t DS1302_REG_CH = 0x80; // bit in the seconds register
Expand Down

0 comments on commit 4c790ee

Please sign in to comment.