Skip to content

RTC bugs , set second and month bit mask  #1

@wayofka

Description

@wayofka

bug 1)
Setting second not working
in set function is
int state=rtc_bcd[MCP7940_SEC] & MCP7940_CLOCKHALT;
but because
#define MCP7940_CLOCKHALT B01111111
and state is store in highest bit
there should be
int state=rtc_bcd[MCP7940_SEC] & ~(MCP7940_CLOCKHALT);

bug 2) month bit mask
high month bitmask is only one bit, not two
#define MCP7940_HI_MTH B00110000
http://ww1.microchip.com/downloads/en/DeviceDoc/20002292B.pdf
should be
#define MCP7940_HI_MTH B00010000

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions