From 12f43e660f98c80c0a9fd49b616ff80c7e9eef6e Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Sun, 12 Mar 2017 17:59:23 -0700 Subject: [PATCH] TIMER: Behave reasonably when a simulator doesn't associate a UNIT with a timer --- sim_timer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sim_timer.c b/sim_timer.c index 6b5c7c63..99674c21 100644 --- a/sim_timer.c +++ b/sim_timer.c @@ -827,7 +827,7 @@ if (rtc_currd[tmr]) time = rtc_currd[tmr]; if (!uptr) uptr = sim_clock_unit[tmr]; -sim_debug (DBG_CAL, &sim_timer_dev, "sim_rtcn_init_unit(unit=%s, time=%d, tmr=%d)\n", sim_uname(uptr), time, tmr); +sim_debug (DBG_CAL, &sim_timer_dev, "sim_rtcn_init_unit(unit=%s, time=%d, tmr=%d)\n", uptr ? sim_uname(uptr) : "", time, tmr); if (uptr) { if (!sim_clock_unit[tmr]) sim_register_clock_unit_tmr (uptr, tmr); @@ -2093,7 +2093,8 @@ int32 tmr; sim_int_clk_tps = MIN(CLK_TPS, sim_os_tick_hz); for (tmr=0; tmr