ztest_new: add CONFIG_ZTEST_NO_YIELD to ztest_new
Rather than yielding to idle thread, keep the part awake. So debugger can still access it, since some SOCs cannot be debugged in low power states. Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
This commit is contained in:
parent
8f37003401
commit
acf3755d1c
1 changed files with 23 additions and 0 deletions
|
@ -1079,7 +1079,18 @@ int main(void)
|
||||||
z_init_mock();
|
z_init_mock();
|
||||||
test_main();
|
test_main();
|
||||||
end_report();
|
end_report();
|
||||||
|
#ifdef CONFIG_ZTEST_NO_YIELD
|
||||||
|
/*
|
||||||
|
* Rather than yielding to idle thread, keep the part awake so debugger can
|
||||||
|
* still access it, since some SOCs cannot be debugged in low power states.
|
||||||
|
*/
|
||||||
|
uint32_t key = irq_lock();
|
||||||
|
|
||||||
|
while (1) {
|
||||||
|
; /* Spin */
|
||||||
|
}
|
||||||
|
irq_unlock(key);
|
||||||
|
#endif
|
||||||
return test_status;
|
return test_status;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
@ -1124,6 +1135,18 @@ int main(void)
|
||||||
state.boots = 0;
|
state.boots = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifdef CONFIG_ZTEST_NO_YIELD
|
||||||
|
/*
|
||||||
|
* Rather than yielding to idle thread, keep the part awake so debugger can
|
||||||
|
* still access it, since some SOCs cannot be debugged in low power states.
|
||||||
|
*/
|
||||||
|
uint32_t key = irq_lock();
|
||||||
|
|
||||||
|
while (1) {
|
||||||
|
; /* Spin */
|
||||||
|
}
|
||||||
|
irq_unlock(key);
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue