v0.5 fix patch
This commit is contained in:
parent
efab6c2ff3
commit
e1a77fc1ca
@ -2,6 +2,6 @@
|
||||
#define VERSION_H_
|
||||
|
||||
#define VERSION_MAJOR (0)
|
||||
#define VERSION_MINOR (3)
|
||||
#define VERSION_MINOR (5)
|
||||
|
||||
#endif /* VERSION_H_ */
|
||||
|
@ -200,7 +200,7 @@ extern void HAL_I2C_AddrCallback(I2C_HandleTypeDef *hi2c, uint8_t TransferDirect
|
||||
HAL_RTC_SetDate(&hrtc, &date_s, RTC_FORMAT_BIN);
|
||||
}
|
||||
|
||||
HAL_RTC_GetDate(&hrtc, &date_s, RTC_FORMAT_BCD);
|
||||
HAL_RTC_GetDate(&hrtc, &date_s, RTC_FORMAT_BIN);
|
||||
i2cs_fill_buffer_RTC_date(&i2cs_w_buff[1], &date_s);
|
||||
|
||||
i2cs_w_len = 5;
|
||||
@ -212,7 +212,7 @@ extern void HAL_I2C_AddrCallback(I2C_HandleTypeDef *hi2c, uint8_t TransferDirect
|
||||
HAL_RTC_SetTime(&hrtc, &time_s, RTC_FORMAT_BIN);
|
||||
}
|
||||
|
||||
HAL_RTC_GetTime(&hrtc, &time_s, RTC_FORMAT_BCD);
|
||||
HAL_RTC_GetTime(&hrtc, &time_s, RTC_FORMAT_BIN);
|
||||
i2cs_fill_buffer_RTC_time(&i2cs_w_buff[1], &time_s);
|
||||
|
||||
i2cs_w_len = 4;
|
||||
@ -280,14 +280,15 @@ extern void HAL_I2C_SlaveRxCpltCallback(I2C_HandleTypeDef *hi2c) {
|
||||
reg == REG_ID_FRQ) {
|
||||
if (is_write)
|
||||
bytes_needed = 1;
|
||||
|
||||
} else if (reg == REG_ID_DEB) {
|
||||
if (is_write)
|
||||
bytes_needed = 2;
|
||||
} else if (reg == REG_ID_RTC_TIME ||
|
||||
reg == REG_ID_RTC_DATE) {
|
||||
} else if (reg == REG_ID_RTC_DATE ||
|
||||
reg == REG_ID_RTC_ALARM_DATE ||
|
||||
reg == REG_ID_RTC_TIME ||
|
||||
reg == REG_ID_RTC_ALARM_TIME) {
|
||||
if (is_write)
|
||||
bytes_needed = 4;
|
||||
bytes_needed = 3;
|
||||
}
|
||||
|
||||
if (bytes_needed > 0)
|
||||
|
@ -12,7 +12,7 @@ extern void HAL_RTC_AlarmAEventCallback(RTC_HandleTypeDef *hrtc) {
|
||||
uint8_t date_valid = 1;
|
||||
|
||||
if ((rtc_conf & RTC_CFG_DATE_ALARM) == RTC_CFG_DATE_ALARM) {
|
||||
HAL_RTC_GetDate(hrtc, &date_s, RTC_FORMAT_BCD);
|
||||
HAL_RTC_GetDate(hrtc, &date_s, RTC_FORMAT_BIN);
|
||||
if (date_s.Year != rtc_alarm_date._s.Year ||
|
||||
date_s.Month != rtc_alarm_date._s.Month ||
|
||||
date_s.Date != rtc_alarm_date._s.Date)
|
||||
@ -73,7 +73,7 @@ inline uint32_t rtc_run_alarm(void) {
|
||||
alarm_s.AlarmTime.Hours = rtc_alarm_time._s.Hours;
|
||||
alarm_s.AlarmTime.Minutes = rtc_alarm_time._s.Minutes;
|
||||
alarm_s.AlarmTime.Seconds = rtc_alarm_time._s.Seconds;
|
||||
return (uint32_t)HAL_RTC_SetAlarm_IT(&hrtc, &alarm_s, RTC_FORMAT_BCD);
|
||||
return (uint32_t)HAL_RTC_SetAlarm_IT(&hrtc, &alarm_s, RTC_FORMAT_BIN);
|
||||
}
|
||||
|
||||
inline uint32_t rtc_stop_alarm(void) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user