Skip to content

Commit fc7c70d

Browse files
Keyur HariyaKeyur Hariya
authored andcommitted
Fix the initialization of a structure
1 parent 0ca1a61 commit fc7c70d

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

targets/TARGET_Maxim/TARGET_MAX32620C/rtc_api.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include "lp_ticker_api.h"
3636
#include "rtc.h"
3737
#include "lp.h"
38+
#include <string.h>
3839

3940
// LOG2 for 32-bit powers of 2
4041
#define LOG2_1(n) (((n) >= (1 << 1)) ? 1 : 0)
@@ -65,7 +66,8 @@ static void init_rtc(void)
6566
* if it is already running.
6667
*/
6768
if (!RTC_IsActive()) {
68-
rtc_cfg_t cfg = { 0 };
69+
rtc_cfg_t cfg;
70+
memset(&cfg, 0, sizeof(rtc_cfg_t));
6971
cfg.prescaler = LP_TIMER_PRESCALE;
7072
cfg.snoozeMode = RTC_SNOOZE_DISABLE;
7173

targets/TARGET_Maxim/TARGET_MAX32625/rtc_api.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include "lp_ticker_api.h"
3636
#include "rtc.h"
3737
#include "lp.h"
38+
#include <string.h>
3839

3940
// LOG2 for 32-bit powers of 2
4041
#define LOG2_1(n) (((n) >= (1 << 1)) ? 1 : 0)
@@ -65,7 +66,8 @@ static void init_rtc(void)
6566
* if it is already running.
6667
*/
6768
if (!RTC_IsActive()) {
68-
rtc_cfg_t cfg = { 0 };
69+
rtc_cfg_t cfg;
70+
memset(&cfg, 0, sizeof(rtc_cfg_t));
6971
cfg.prescaler = LP_TIMER_PRESCALE;
7072
cfg.snoozeMode = RTC_SNOOZE_DISABLE;
7173

targets/TARGET_Maxim/TARGET_MAX32630/rtc_api.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include "lp_ticker_api.h"
3636
#include "rtc.h"
3737
#include "lp.h"
38+
#include <string.h>
3839

3940
// LOG2 for 32-bit powers of 2
4041
#define LOG2_1(n) (((n) >= (1 << 1)) ? 1 : 0)
@@ -65,7 +66,8 @@ static void init_rtc(void)
6566
* if it is already running.
6667
*/
6768
if (!RTC_IsActive()) {
68-
rtc_cfg_t cfg = {0};
69+
rtc_cfg_t cfg;
70+
memset(&cfg, 0, sizeof(rtc_cfg_t));
6971
cfg.prescaler = LP_TIMER_PRESCALE;
7072
cfg.snoozeMode = RTC_SNOOZE_DISABLE;
7173

0 commit comments

Comments
 (0)