Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/iicbus/rtc/hym8563.c
Show First 20 Lines • Show All 164 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
struct hym8563_softc *sc; | struct hym8563_softc *sc; | ||||
struct bcd_clocktime bct; | struct bcd_clocktime bct; | ||||
uint8_t buf[7]; | uint8_t buf[7]; | ||||
int rv; | int rv; | ||||
sc = device_get_softc(dev); | sc = device_get_softc(dev); | ||||
ts->tv_sec -= utc_offset(); | ts->tv_sec -= utc_offset(); | ||||
clock_ts_to_bcd(ts, &bct, false); | rv = clock_ts_to_bcd(ts, &bct, false); | ||||
if (rv) | |||||
return (rv); | |||||
clock_dbgprint_bcd(sc->dev, CLOCK_DBG_WRITE, &bct); | clock_dbgprint_bcd(sc->dev, CLOCK_DBG_WRITE, &bct); | ||||
buf[0] = bct.sec; /* Also clear VL flag */ | buf[0] = bct.sec; /* Also clear VL flag */ | ||||
buf[1] = bct.min; | buf[1] = bct.min; | ||||
buf[2] = bct.hour; | buf[2] = bct.hour; | ||||
buf[3] = bct.day; | buf[3] = bct.day; | ||||
buf[4] = bct.dow; | buf[4] = bct.dow; | ||||
buf[5] = bct.mon; | buf[5] = bct.mon; | ||||
▲ Show 20 Lines • Show All 132 Lines • Show Last 20 Lines |