push for windows
This commit is contained in:
@@ -19,16 +19,13 @@ void watch_registers_get_config_settings(uint8_t config, bool* is_paused, time_f
|
||||
}
|
||||
|
||||
void watch_registers_set_time_hours(uint8_t* time_bits_low, uint8_t* time_bits_high, uint8_t hours){
|
||||
if (hours > 11) hours = 11;
|
||||
*time_bits_high = (*time_bits_high & 0x0F) | ((hours & 0x0F) << 4); // Set the upper nibble
|
||||
}
|
||||
void watch_registers_set_time_minutes(uint8_t* time_bits_low, uint8_t* time_bits_high, uint8_t minutes){
|
||||
if (minutes > 59) minutes = 59;
|
||||
*time_bits_high = (*time_bits_high & 0xF0) | ((minutes >> 2) & 0x0F); // Set the lower nibble of MSB
|
||||
*time_bits_low = (*time_bits_low & 0x3F) | ((minutes & 0x03) << 6); // Set the upper two bits of LSB
|
||||
}
|
||||
void watch_registers_set_time_seconds(uint8_t* time_bits_low, uint8_t* time_bits_high, uint8_t seconds){
|
||||
if (seconds > 59) seconds = 59;
|
||||
*time_bits_low = (*time_bits_low & 0xC0) | (seconds & 0x3F); // Set the lower 6 bits of LSB
|
||||
}
|
||||
void watch_registers_get_time(uint8_t time_bits_low, uint8_t time_bits_high, uint8_t* hours, uint8_t* minutes, uint8_t* seconds){
|
||||
@@ -38,18 +35,13 @@ void watch_registers_get_time(uint8_t time_bits_low, uint8_t time_bits_high, uin
|
||||
}
|
||||
|
||||
void watch_registers_set_date_year(uint8_t* date_bits_low, uint8_t* date_bits_high, uint8_t year){
|
||||
if (year > 127) year = 127; // Maximum year value is 127 (0x7F) for 7 bits
|
||||
*date_bits_low = (*date_bits_low & 0x80) | (year & 0x7F); // Set the lower 2 bits of LSB
|
||||
}
|
||||
void watch_registers_set_date_month(uint8_t* date_bits_low, uint8_t* date_bits_high, uint8_t month){
|
||||
if (month > 12) month = 12; // Maximum month value is 12
|
||||
else if (month < 1) month = 1; // Minimum month value is 1
|
||||
*date_bits_high = (*date_bits_high & 0xF8) | ((month >> 1) & 0x07);
|
||||
*date_bits_low = (*date_bits_low & 0x7F) | ((month & 0x01) << 7);
|
||||
}
|
||||
void watch_registers_set_date_day_of_month(uint8_t* date_bits_low, uint8_t* date_bits_high,uint8_t day_of_month){
|
||||
if (day_of_month > 31) day_of_month = 31; // Maximum day of month value is 31
|
||||
else if (day_of_month < 1) day_of_month = 1; // Minimum day of month value is 1
|
||||
*date_bits_high = (*date_bits_high & 0x07) | ((day_of_month & 0x1F) << 3); // Set the upper 5 bits of MSB
|
||||
}
|
||||
void watch_registers_get_date(uint8_t date_bits_low, uint8_t date_bits_high, uint8_t* year, uint8_t* month, uint8_t* day_of_month){
|
||||
|
||||
Reference in New Issue
Block a user