RTC. Fixed bug 3526084
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4196 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
934daa134a
commit
c64bdaf619
|
@ -105,8 +105,10 @@ void rtc_lld_init(void){
|
||||||
rtc_lld_enter_init();
|
rtc_lld_enter_init();
|
||||||
|
|
||||||
/* Prescaler register must be written in two SEPARATE writes. */
|
/* Prescaler register must be written in two SEPARATE writes. */
|
||||||
RTCD1.id_rtc->PRER = prediv_a << 16;
|
prediv_a = (prediv_a << 16) |
|
||||||
RTCD1.id_rtc->PRER = ((STM32_RTCCLK / (prediv_a + 1)) - 1) & 0x7FFF;
|
(((STM32_RTCCLK / (prediv_a + 1)) - 1) & 0x7FFF);
|
||||||
|
RTCD1.id_rtc->PRER = prediv_a;
|
||||||
|
RTCD1.id_rtc->PRER = prediv_a;
|
||||||
rtc_lld_exit_init();
|
rtc_lld_exit_init();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,7 +87,7 @@ static void func_sleep(void){
|
||||||
__WFI();
|
__WFI();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cmd_sleep(BaseChannel *chp, int argc, char *argv[]){
|
static void cmd_sleep(BaseSequentialStream *chp, int argc, char *argv[]){
|
||||||
(void)argv;
|
(void)argv;
|
||||||
if (argc > 0) {
|
if (argc > 0) {
|
||||||
chprintf(chp, "Usage: sleep\r\n");
|
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;
|
int i = 0;
|
||||||
|
|
||||||
(void)argv;
|
(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;
|
(void)argv;
|
||||||
struct tm timp;
|
struct tm timp;
|
||||||
|
|
||||||
|
@ -198,7 +198,7 @@ static const ShellCommand commands[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static const ShellConfig shell_cfg1 = {
|
static const ShellConfig shell_cfg1 = {
|
||||||
(BaseChannel *)&SD2,
|
(BaseSequentialStream *)&SD2,
|
||||||
commands
|
commands
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue