@ -75,6 +75,12 @@
/*
* RTC driver system settings for stm32f303
*/
#define RTC_PRER(a, s) ((((a) - 1) << 16) | ((s) - 1))
// LSE for 32768 quartz
#define STM32_RTC_LSE_PRER RTC_PRER(128, 256)
// LSI 40k
#define STM32_RTC_LSI_PRER RTC_PRER( 40, 1000)
#ifndef VNA_USE_LSE
// Use 40kHz LSI
@ -122,7 +122,7 @@
* @brief Enables the RTC subsystem.
#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)
#define HAL_USE_RTC TRUE
#define HAL_USE_RTC FALSE
#endif
/**
@ -2890,7 +2890,12 @@ int main(void)
{
halInit();
chSysInit();
* Initialize RTC library (not used ChibiOS RTC module)
#ifdef __USE_RTC__
rtc_init();
//palSetPadMode(GPIOB, 8, PAL_MODE_ALTERNATE(1) | PAL_STM32_OTYPE_OPENDRAIN);
//palSetPadMode(GPIOB, 9, PAL_MODE_ALTERNATE(1) | PAL_STM32_OTYPE_OPENDRAIN);
#ifdef __VNA__
@ -26,7 +26,7 @@
// Compact STM32 RTC time library
#if HAL_USE_RTC == TRUE
//#error "Error VNA use self RTC lib, define HAL_USE_RTC = FALSE in halconf.h"
#error "Error VNA use self RTC lib, define HAL_USE_RTC = FALSE in halconf.h"
// Get RTC time as binary structure in 0x00HHMMSS
Powered by TurnKey Linux.