mirror of https://github.com/ARMmbed/mbed-os.git
Fix the initialization of a structure
parent
0ca1a61ba0
commit
fc7c70dbc6
|
@ -35,6 +35,7 @@
|
||||||
#include "lp_ticker_api.h"
|
#include "lp_ticker_api.h"
|
||||||
#include "rtc.h"
|
#include "rtc.h"
|
||||||
#include "lp.h"
|
#include "lp.h"
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
// LOG2 for 32-bit powers of 2
|
// LOG2 for 32-bit powers of 2
|
||||||
#define LOG2_1(n) (((n) >= (1 << 1)) ? 1 : 0)
|
#define LOG2_1(n) (((n) >= (1 << 1)) ? 1 : 0)
|
||||||
|
@ -65,7 +66,8 @@ static void init_rtc(void)
|
||||||
* if it is already running.
|
* if it is already running.
|
||||||
*/
|
*/
|
||||||
if (!RTC_IsActive()) {
|
if (!RTC_IsActive()) {
|
||||||
rtc_cfg_t cfg = { 0 };
|
rtc_cfg_t cfg;
|
||||||
|
memset(&cfg, 0, sizeof(rtc_cfg_t));
|
||||||
cfg.prescaler = LP_TIMER_PRESCALE;
|
cfg.prescaler = LP_TIMER_PRESCALE;
|
||||||
cfg.snoozeMode = RTC_SNOOZE_DISABLE;
|
cfg.snoozeMode = RTC_SNOOZE_DISABLE;
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
#include "lp_ticker_api.h"
|
#include "lp_ticker_api.h"
|
||||||
#include "rtc.h"
|
#include "rtc.h"
|
||||||
#include "lp.h"
|
#include "lp.h"
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
// LOG2 for 32-bit powers of 2
|
// LOG2 for 32-bit powers of 2
|
||||||
#define LOG2_1(n) (((n) >= (1 << 1)) ? 1 : 0)
|
#define LOG2_1(n) (((n) >= (1 << 1)) ? 1 : 0)
|
||||||
|
@ -65,7 +66,8 @@ static void init_rtc(void)
|
||||||
* if it is already running.
|
* if it is already running.
|
||||||
*/
|
*/
|
||||||
if (!RTC_IsActive()) {
|
if (!RTC_IsActive()) {
|
||||||
rtc_cfg_t cfg = { 0 };
|
rtc_cfg_t cfg;
|
||||||
|
memset(&cfg, 0, sizeof(rtc_cfg_t));
|
||||||
cfg.prescaler = LP_TIMER_PRESCALE;
|
cfg.prescaler = LP_TIMER_PRESCALE;
|
||||||
cfg.snoozeMode = RTC_SNOOZE_DISABLE;
|
cfg.snoozeMode = RTC_SNOOZE_DISABLE;
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
#include "lp_ticker_api.h"
|
#include "lp_ticker_api.h"
|
||||||
#include "rtc.h"
|
#include "rtc.h"
|
||||||
#include "lp.h"
|
#include "lp.h"
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
// LOG2 for 32-bit powers of 2
|
// LOG2 for 32-bit powers of 2
|
||||||
#define LOG2_1(n) (((n) >= (1 << 1)) ? 1 : 0)
|
#define LOG2_1(n) (((n) >= (1 << 1)) ? 1 : 0)
|
||||||
|
@ -65,7 +66,8 @@ static void init_rtc(void)
|
||||||
* if it is already running.
|
* if it is already running.
|
||||||
*/
|
*/
|
||||||
if (!RTC_IsActive()) {
|
if (!RTC_IsActive()) {
|
||||||
rtc_cfg_t cfg = {0};
|
rtc_cfg_t cfg;
|
||||||
|
memset(&cfg, 0, sizeof(rtc_cfg_t));
|
||||||
cfg.prescaler = LP_TIMER_PRESCALE;
|
cfg.prescaler = LP_TIMER_PRESCALE;
|
||||||
cfg.snoozeMode = RTC_SNOOZE_DISABLE;
|
cfg.snoozeMode = RTC_SNOOZE_DISABLE;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue