v0.5 fix patch
This commit is contained in:
parent
efab6c2ff3
commit
f385be34aa
@ -2,6 +2,6 @@
|
||||
#define VERSION_H_
|
||||
|
||||
#define VERSION_MAJOR (0)
|
||||
#define VERSION_MINOR (3)
|
||||
#define VERSION_MINOR (5)
|
||||
|
||||
#endif /* VERSION_H_ */
|
||||
|
@ -197,7 +197,7 @@ extern void HAL_I2C_AddrCallback(I2C_HandleTypeDef *hi2c, uint8_t TransferDirect
|
||||
if (is_write) {
|
||||
i2cs_RTC_date_from_buffer(&date_s, &i2cs_r_buff[1]);
|
||||
|
||||
HAL_RTC_SetDate(&hrtc, &date_s, RTC_FORMAT_BIN);
|
||||
HAL_RTC_SetDate(&hrtc, &date_s, RTC_FORMAT_BCD);
|
||||
}
|
||||
|
||||
HAL_RTC_GetDate(&hrtc, &date_s, RTC_FORMAT_BCD);
|
||||
@ -209,7 +209,7 @@ extern void HAL_I2C_AddrCallback(I2C_HandleTypeDef *hi2c, uint8_t TransferDirect
|
||||
if (is_write) {
|
||||
i2cs_RTC_time_from_buffer(&time_s, &i2cs_r_buff[1]);
|
||||
|
||||
HAL_RTC_SetTime(&hrtc, &time_s, RTC_FORMAT_BIN);
|
||||
HAL_RTC_SetTime(&hrtc, &time_s, RTC_FORMAT_BCD);
|
||||
}
|
||||
|
||||
HAL_RTC_GetTime(&hrtc, &time_s, RTC_FORMAT_BCD);
|
||||
@ -280,12 +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_DATE ||
|
||||
reg == REG_ID_RTC_ALARM_DATE) {
|
||||
if (is_write)
|
||||
bytes_needed = 3;
|
||||
} else if (reg == REG_ID_RTC_TIME ||
|
||||
reg == REG_ID_RTC_DATE) {
|
||||
reg == REG_ID_RTC_ALARM_TIME) {
|
||||
if (is_write)
|
||||
bytes_needed = 4;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user