/* Handler to perform various actions from within an ISR context. 
This routine is the ISR handler for isr_handler_trigger(). It performs the command requested in <isr_info.command>.  */
static void isr_handler(const void *data)
/* Handler to perform various actions from within an ISR context. 
This routine is the ISR handler for isr_handler_trigger(). It performs the command requested in <isr_info.command>.  */
static void isr_handler(const void *data)
{
	ARG_UNUSED(data);
	if (k_can_yield()) {
		isr_info.error = INVALID_BEHAVIOUR;
	}
	switch (isr_info.command) {
	case THREAD_SELF_CMD:
		isr_info.data = (void *)k_current_get();
		break;
	case EXEC_CTX_TYPE_CMD:
		if (k_is_in_isr()) {
			isr_info.value = K_ISR;
			break;
		}
		if (_current->base.prio < 0) {
			isr_info.value = K_COOP_THREAD;
			break;
		}
		isr_info.value = K_PREEMPT_THREAD;
		break;
	default:
		isr_info.error = UNKNOWN_COMMAND;
		break;
	}
}