v0.5 fix patch

This commit is contained in:
JackCarterSmith 2025-06-01 10:54:52 +02:00
parent efab6c2ff3
commit f385be34aa
Signed by: JackCarterSmith
GPG Key ID: 832E52F4E23F8F24
2 changed files with 8 additions and 5 deletions

View File

@ -2,6 +2,6 @@
#define VERSION_H_ #define VERSION_H_
#define VERSION_MAJOR (0) #define VERSION_MAJOR (0)
#define VERSION_MINOR (3) #define VERSION_MINOR (5)
#endif /* VERSION_H_ */ #endif /* VERSION_H_ */

View File

@ -197,7 +197,7 @@ extern void HAL_I2C_AddrCallback(I2C_HandleTypeDef *hi2c, uint8_t TransferDirect
if (is_write) { if (is_write) {
i2cs_RTC_date_from_buffer(&date_s, &i2cs_r_buff[1]); 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); 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) { if (is_write) {
i2cs_RTC_time_from_buffer(&time_s, &i2cs_r_buff[1]); 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); 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) { reg == REG_ID_FRQ) {
if (is_write) if (is_write)
bytes_needed = 1; bytes_needed = 1;
} else if (reg == REG_ID_DEB) { } else if (reg == REG_ID_DEB) {
if (is_write) if (is_write)
bytes_needed = 2; 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 || } else if (reg == REG_ID_RTC_TIME ||
reg == REG_ID_RTC_DATE) { reg == REG_ID_RTC_ALARM_TIME) {
if (is_write) if (is_write)
bytes_needed = 4; bytes_needed = 4;
} }