diff options
author | barthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2012-05-14 17:40:44 +0000 |
---|---|---|
committer | barthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2012-05-14 17:40:44 +0000 |
commit | c64bdaf6190868f95f463015f28541b4ebf230ef (patch) | |
tree | c89be2cd5677bef49f3347e11c450437478c1496 | |
parent | 934daa134a35a2b94e7d81a2143861c48c69b616 (diff) | |
download | ChibiOS-c64bdaf6190868f95f463015f28541b4ebf230ef.tar.gz ChibiOS-c64bdaf6190868f95f463015f28541b4ebf230ef.tar.bz2 ChibiOS-c64bdaf6190868f95f463015f28541b4ebf230ef.zip |
RTC. Fixed bug 3526084
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4196 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r-- | os/hal/platforms/STM32/RTCv2/rtc_lld.c | 6 | ||||
-rw-r--r-- | testhal/STM32F4xx/RTC/main.c | 8 |
2 files changed, 8 insertions, 6 deletions
diff --git a/os/hal/platforms/STM32/RTCv2/rtc_lld.c b/os/hal/platforms/STM32/RTCv2/rtc_lld.c index 870734fba..84295bd76 100644 --- a/os/hal/platforms/STM32/RTCv2/rtc_lld.c +++ b/os/hal/platforms/STM32/RTCv2/rtc_lld.c @@ -105,8 +105,10 @@ void rtc_lld_init(void){ rtc_lld_enter_init();
/* Prescaler register must be written in two SEPARATE writes. */
- RTCD1.id_rtc->PRER = prediv_a << 16;
- RTCD1.id_rtc->PRER = ((STM32_RTCCLK / (prediv_a + 1)) - 1) & 0x7FFF;
+ prediv_a = (prediv_a << 16) |
+ (((STM32_RTCCLK / (prediv_a + 1)) - 1) & 0x7FFF);
+ RTCD1.id_rtc->PRER = prediv_a;
+ RTCD1.id_rtc->PRER = prediv_a;
rtc_lld_exit_init();
}
}
diff --git a/testhal/STM32F4xx/RTC/main.c b/testhal/STM32F4xx/RTC/main.c index ce3e7f13f..c3d54850c 100644 --- a/testhal/STM32F4xx/RTC/main.c +++ b/testhal/STM32F4xx/RTC/main.c @@ -87,7 +87,7 @@ static void func_sleep(void){ __WFI();
}
-static void cmd_sleep(BaseChannel *chp, int argc, char *argv[]){
+static void cmd_sleep(BaseSequentialStream *chp, int argc, char *argv[]){
(void)argv;
if (argc > 0) {
chprintf(chp, "Usage: sleep\r\n");
@@ -104,7 +104,7 @@ static void cmd_sleep(BaseChannel *chp, int argc, char *argv[]){ /*
*
*/
-static void cmd_alarm(BaseChannel *chp, int argc, char *argv[]){
+static void cmd_alarm(BaseSequentialStream *chp, int argc, char *argv[]){
int i = 0;
(void)argv;
@@ -138,7 +138,7 @@ ERROR: /*
*
*/
-static void cmd_date(BaseChannel *chp, int argc, char *argv[]){
+static void cmd_date(BaseSequentialStream *chp, int argc, char *argv[]){
(void)argv;
struct tm timp;
@@ -198,7 +198,7 @@ static const ShellCommand commands[] = { };
static const ShellConfig shell_cfg1 = {
- (BaseChannel *)&SD2,
+ (BaseSequentialStream *)&SD2,
commands
};
|