From 5bfc8ef66647f68e8a4ceadbfe133af172612d76 Mon Sep 17 00:00:00 2001 From: Jakob Krantz Date: Sat, 23 Sep 2023 12:06:00 +0200 Subject: [PATCH] WIP: Fix CI. --- app/src/main.c | 2 +- app/src/zsw_flash.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main.c b/app/src/main.c index 875ecc44..43aa8c77 100644 --- a/app/src/main.c +++ b/app/src/main.c @@ -145,7 +145,7 @@ void run_wdt_work(struct k_work *item) int main(void) { -#ifdef CONFIG_TASK_WDT +#if defined(CONFIG_TASK_WDT) && !defined(CONFIG_BOARD_NATIVE_POSIX) const struct device *hw_wdt_dev = DEVICE_DT_GET(DT_ALIAS(watchdog0)); if (!device_is_ready(hw_wdt_dev)) { printk("Hardware watchdog %s is not ready; ignoring it.\n", diff --git a/app/src/zsw_flash.c b/app/src/zsw_flash.c index 9d4eefe1..899f7787 100644 --- a/app/src/zsw_flash.c +++ b/app/src/zsw_flash.c @@ -77,10 +77,10 @@ static void single_sector_test(const struct device *flash_dev) static int zsw_flash_test(void) { - const struct device *flash_dev = DEVICE_DT_GET(DT_ALIAS(spi_flash0)); + const struct device *flash_dev = DEVICE_DT_GET_OR_NULL(DT_ALIAS(spi_flash0)); - if (!device_is_ready(flash_dev)) { - LOG_ERR("No external flash present: %s", flash_dev->name); + if (!flash_dev || !device_is_ready(flash_dev)) { + LOG_ERR("No external flash present: %s", flash_dev ? flash_dev->name: "spi_flash0"); return 0; }