Skip to content

Commit 9f6f5e8

Browse files
committed
Fix ADC build warning
This fixes an ADC build warning Signed-off-by: John Lange <[email protected]>
1 parent 9aed673 commit 9f6f5e8

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

samples/tmo_shell/src/tmo_adc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ K_SEM_DEFINE(adc_sem, 0, 1);
2525
static ADC_InitSingle_TypeDef initSingle_bv = ADC_INITSINGLE_DEFAULT;
2626
static ADC_InitSingle_TypeDef initSingle_hwid = ADC_INITSINGLE_DEFAULT;
2727

28+
#ifdef HWID_APORT
2829
/**
2930
* @brief Set the VBAT_SNS_EN Pin High to enable ADC readings
3031
*
@@ -39,6 +40,7 @@ static void set_vbat_sens_en(bool enable)
3940
GPIO_PinModeSet(VBAT_EN_PORT, VBAT_EN_PIN, gpioModePushPull, enable);
4041
#endif /* VBAT_EN_PORT */
4142
}
43+
#endif /* HWID_APORT */
4244

4345
/**
4446
* @brief Initialize the Gecko ADC

samples/tmo_shell/src/tmo_sntp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ static void date_print(const struct shell *shell, struct tm *tm)
8383
static int time_date_set(const struct shell *shell, uint32_t epoch_sec)
8484
{
8585
struct tm tm;
86-
struct timespec tp;
86+
struct timespec tp = {0};
8787
tp.tv_sec = (uint32_t)epoch_sec;
8888

8989
gmtime_r(&tp.tv_sec, &tm);
@@ -203,7 +203,7 @@ int tmo_update_time(const struct shell *shell, char *host, int iface_idx)
203203
#ifdef DEBUG
204204
shell_print(shell, "epoch %lld", txTm);
205205
#endif
206-
time_date_set(shell,txTm);
206+
time_date_set(shell, txTm);
207207
zsock_close(sd);
208208
return 0;
209209
}

0 commit comments

Comments
 (0)