Lines Matching full:state
10 * the RTC state. Plus we have to read the state multiple times because we're
26 * A snapshot of the RTC state, or at least the state we're
36 struct state { struct
49 * values in 'struct state' are BCD-encoded. argument
56 * the members of 'struct state'.
62 * Interesting bits in 'struct state'.
88 /* Populate 'state' with current RTC state. */
90 void read_state(struct state *state) in read_state() argument
95 p = (uint8_t *) state; in read_state()
96 for (i = 0; i < sizeof(*state); ++i) { in read_state()
135 struct state state, state2; in get_value() local
136 uint64_t *pun = (uint64_t *) &state; in get_value()
144 * Read the state until we see the same state twice in a row. in get_value()
149 state = state2; in get_value()
154 * Normalize the state; 12hr -> 24hr, BCD -> decimal. in get_value()
159 if ((state.status_b & STATUS_B_24HR) != 0U) { in get_value()
162 pm = ((state.hour & HOUR_PM) == HOUR_PM); in get_value()
163 state.hour &= ~HOUR_PM; in get_value()
166 if ((state.status_b & STATUS_B_BIN) == 0U) { in get_value()
167 uint8_t *cp = (uint8_t *) &state; in get_value()
177 state.hour = (state.hour + 12) % 24; in get_value()
187 epoch = hinnant(state.year + 2000, state.month, state.day); in get_value()
189 epoch += state.hour * 3600; /* seconds per hour */ in get_value()
190 epoch += state.minute * 60; /* seconds per minute */ in get_value()
191 epoch += state.second; in get_value()