Fixed bug #799.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/stable_16.1.x@9973 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
97724e808c
commit
3b6fc2ad8a
|
@ -50,6 +50,8 @@
|
||||||
#define RTC_DR_DT_OFFSET 4
|
#define RTC_DR_DT_OFFSET 4
|
||||||
#define RTC_DR_DU_OFFSET 0
|
#define RTC_DR_DU_OFFSET 0
|
||||||
|
|
||||||
|
#define RTC_CR_BKP_OFFSET 18
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver exported variables. */
|
/* Driver exported variables. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
@ -343,8 +345,9 @@ void rtc_lld_set_time(RTCDriver *rtcp, const RTCDateTime *timespec) {
|
||||||
|
|
||||||
/* Writing the registers.*/
|
/* Writing the registers.*/
|
||||||
rtc_enter_init();
|
rtc_enter_init();
|
||||||
rtcp->rtc->TR = tr;
|
rtcp->rtc->TR = tr;
|
||||||
rtcp->rtc->DR = dr;
|
rtcp->rtc->DR = dr;
|
||||||
|
rtcp->rtc->CR |= timespec->dstflag << RTC_CR_BKP_OFFSET;
|
||||||
rtc_exit_init();
|
rtc_exit_init();
|
||||||
|
|
||||||
/* Leaving a reentrant critical zone.*/
|
/* Leaving a reentrant critical zone.*/
|
||||||
|
@ -361,7 +364,7 @@ void rtc_lld_set_time(RTCDriver *rtcp, const RTCDateTime *timespec) {
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
void rtc_lld_get_time(RTCDriver *rtcp, RTCDateTime *timespec) {
|
void rtc_lld_get_time(RTCDriver *rtcp, RTCDateTime *timespec) {
|
||||||
uint32_t dr, tr;
|
uint32_t dr, tr, cr;
|
||||||
uint32_t subs;
|
uint32_t subs;
|
||||||
#if STM32_RTC_HAS_SUBSECONDS
|
#if STM32_RTC_HAS_SUBSECONDS
|
||||||
uint32_t ssr;
|
uint32_t ssr;
|
||||||
|
@ -380,6 +383,7 @@ void rtc_lld_get_time(RTCDriver *rtcp, RTCDateTime *timespec) {
|
||||||
#endif /* STM32_RTC_HAS_SUBSECONDS */
|
#endif /* STM32_RTC_HAS_SUBSECONDS */
|
||||||
tr = rtcp->rtc->TR;
|
tr = rtcp->rtc->TR;
|
||||||
dr = rtcp->rtc->DR;
|
dr = rtcp->rtc->DR;
|
||||||
|
cr = rtcp->rtc->CR;
|
||||||
rtcp->rtc->ISR &= ~RTC_ISR_RSF;
|
rtcp->rtc->ISR &= ~RTC_ISR_RSF;
|
||||||
|
|
||||||
/* Leaving a reentrant critical zone.*/
|
/* Leaving a reentrant critical zone.*/
|
||||||
|
@ -400,6 +404,9 @@ void rtc_lld_get_time(RTCDriver *rtcp, RTCDateTime *timespec) {
|
||||||
|
|
||||||
/* Decoding date, this concludes the atomic read sequence.*/
|
/* Decoding date, this concludes the atomic read sequence.*/
|
||||||
rtc_decode_date(dr, timespec);
|
rtc_decode_date(dr, timespec);
|
||||||
|
|
||||||
|
/* Retrieving the DST bit.*/
|
||||||
|
timespec->dstflag = (cr >> RTC_CR_BKP_OFFSET) & 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (RTC_ALARMS > 0) || defined(__DOXYGEN__)
|
#if (RTC_ALARMS > 0) || defined(__DOXYGEN__)
|
||||||
|
|
|
@ -73,6 +73,7 @@
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
|
|
||||||
*** 16.1.6 ***
|
*** 16.1.6 ***
|
||||||
|
- HAL: Fixed STM32 RTCv2 driver does not handle the DST bit (bug #799).
|
||||||
- HAL: Fixed MAC driver broken on STM32F107 (bug #798).
|
- HAL: Fixed MAC driver broken on STM32F107 (bug #798).
|
||||||
- VAR: Fixed missing const qualifier in local shell commands array (bug #797).
|
- VAR: Fixed missing const qualifier in local shell commands array (bug #797).
|
||||||
- VAR: Fixed compilation error in cmsis_os.h (bug #796).
|
- VAR: Fixed compilation error in cmsis_os.h (bug #796).
|
||||||
|
|
Loading…
Reference in New Issue