From 14b7acbee5e28e37a9e87469f98905130d3e5f41 Mon Sep 17 00:00:00 2001 From: John Lange Date: Mon, 27 Mar 2023 16:39:55 -0600 Subject: [PATCH] Fix ADC build warning This fixes an ADC build warning Signed-off-by: John Lange --- samples/tmo_shell/src/tmo_adc.c | 2 ++ samples/tmo_shell/src/tmo_sntp.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/samples/tmo_shell/src/tmo_adc.c b/samples/tmo_shell/src/tmo_adc.c index c6dc12c..16f49a3 100644 --- a/samples/tmo_shell/src/tmo_adc.c +++ b/samples/tmo_shell/src/tmo_adc.c @@ -25,6 +25,7 @@ K_SEM_DEFINE(adc_sem, 0, 1); static ADC_InitSingle_TypeDef initSingle_bv = ADC_INITSINGLE_DEFAULT; static ADC_InitSingle_TypeDef initSingle_hwid = ADC_INITSINGLE_DEFAULT; +#ifdef HWID_APORT /** * @brief Set the VBAT_SNS_EN Pin High to enable ADC readings * @@ -39,6 +40,7 @@ static void set_vbat_sens_en(bool enable) GPIO_PinModeSet(VBAT_EN_PORT, VBAT_EN_PIN, gpioModePushPull, enable); #endif /* VBAT_EN_PORT */ } +#endif /* HWID_APORT */ /** * @brief Initialize the Gecko ADC diff --git a/samples/tmo_shell/src/tmo_sntp.c b/samples/tmo_shell/src/tmo_sntp.c index c3ad56c..48bfb60 100644 --- a/samples/tmo_shell/src/tmo_sntp.c +++ b/samples/tmo_shell/src/tmo_sntp.c @@ -83,7 +83,7 @@ static void date_print(const struct shell *shell, struct tm *tm) static int time_date_set(const struct shell *shell, uint32_t epoch_sec) { struct tm tm; - struct timespec tp; + struct timespec tp = {0}; tp.tv_sec = (uint32_t)epoch_sec; gmtime_r(&tp.tv_sec, &tm); @@ -203,7 +203,7 @@ int tmo_update_time(const struct shell *shell, char *host, int iface_idx) #ifdef DEBUG shell_print(shell, "epoch %lld", txTm); #endif - time_date_set(shell,txTm); + time_date_set(shell, txTm); zsock_close(sd); return 0; }