RTC compiles and doesn't crash anymore, but also doesn't run

pull/476/head
Sissors 2014-09-09 20:51:13 +02:00
parent 6585203559
commit c9194f0f9e
2 changed files with 4 additions and 3 deletions

View File

@ -35,7 +35,7 @@
#define DEVICE_CAN 0
#define DEVICE_RTC 0
#define DEVICE_RTC 1
#define DEVICE_ETHERNET 0

View File

@ -26,8 +26,9 @@ void rtc_init(void) {
if (PinMap_RTC[0].pin == NC) {
RTC_HAL_SetOscillatorCmd(RTC_BASE, true);
}
SIM_HAL_EnableRtcClock(RTC_BASE, 0U);
SIM_HAL_EnableRtcClock(SIM_BASE, 0U);
RTC_HAL_SetSecsReg(RTC_BASE, 1);
RTC_HAL_Enable(RTC_BASE);
RTC_HAL_Init(RTC_BASE);
// select RTC clock source
@ -46,7 +47,7 @@ void rtc_free(void) {
* 0 = Disabled, 1 = Enabled
*/
int rtc_isenabled(void) {
SIM_HAL_EnableRtcClock(RTC_BASE, 0U);
SIM_HAL_EnableRtcClock(SIM_BASE, 0U);
return (int)RTC_HAL_IsCounterEnabled(RTC_BASE);
}