
QDK™
M16C/Neutrino-NC30
www.state-machine.com/m16c
case of assertion failure by providing the callback function
Q_onAssert()
. Typically, you would put
the system in fail-safe state and try to reset. It is also a good idea to log some information as to
where the assertion failed.
The following code fragment shows the
Q_onAssert()
callback for M16C. The function simply locks
all interrupts and enters a for-ever loop. This policy is only adequate for testing, but probably is not
adequate for production release.
void Q_onAssert(char const Q_ROM * const Q_ROM_VAR file, int line) {
(void)file; /* avoid compiler warning */
(void)line; /* avoid compiler warning */
QF_INT_LOCK(); /* lock the interrupts */
for (;;) { /* hang in this for-ever loop */
}
}
Copyright © Quantum Leaps, LLC. All Rights Reserved.
20 of 25
Kommentare zu diesen Handbüchern