MCPcopy Create free account
hub / github.com/crosspoint-reader/crosspoint-reader / bcdToDec

Function bcdToDec

lib/hal/HalClock.cpp:17–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15// 0x02: Hours (bit 6 = 12/24 mode, bits 5-4 = tens, bits 3-0 = ones)
16
17static uint8_t bcdToDec(uint8_t bcd) { return ((bcd >> 4) * 10) + (bcd & 0x0F); }
18static uint8_t decToBcd(uint8_t dec) { return ((dec / 10) << 4) | (dec % 10); }
19
20void HalClock::begin() {

Callers 1

getTimeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected