Fix logging of interrupt events.

The system crashed if an interrupt occurs before the
kernel event logger is initialized (Error seen on Galileo).
This patch adds a condition to check if the logger is ready
to operate.

Change-Id: I27d7cc31f386780725b0c47a9c92e9c064fc128a
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
This commit is contained in:
Yonattan Louise 2015-12-02 12:52:21 -06:00 committed by Anas Nashif
commit c5d86e90a1

View file

@ -125,6 +125,11 @@ void _sys_k_event_logger_interrupt(void)
{
uint32_t data[2];
/* if the kernel event logger has not been initialized, we do nothing */
if (sys_k_event_logger.ring_buf.buf == NULL) {
return;
}
data[0] = sys_tick_get_32();
data[1] = _sys_current_irq_key_get();