src/C/devices.c
uint8_t dev_register_handlers(e_device_id dev_id, e_task_id task_id)
{
    if (device_tab[dev_id].status == DEV_STATE_REGISTERED) {
        KERNLOG(DBG_ERR, "dev_register_handlers(): status already set as DEV_STATE_REGISTERED\n");
        return 1;
    }

    for (int i = 0; i < device_tab[dev_id].udev.irq_num; ++i) {

        /* Checking if there is not already a user IRQ handler */
        if (is_interrupt_already_used(device_tab[dev_id].udev.irqs[i].irq)) {
            KERNLOG(DBG_ERR,
                "registering irq handler 0x%x for irq %d fails. This irq is already set\n",
                device_tab[dev_id].udev.irqs[i].handler,
                device_tab[dev_id].udev.irqs[i].irq);
            return 1;
        } else {
            set_interrupt_handler(device_tab[dev_id].udev.irqs[i].irq,
                device_tab[dev_id].udev.irqs[i].handler, task_id, dev_id);
        }
    }

    return 0;
}
/*!
 * \brief Register all the task's device ISR in the IRQ manager
 *
 * ISR will be executed in thread mode, in the task global context, but
 * with a dedicated stack and local autonomous context for save/restore,
 * to support preemption by IRQ.
 */
\brief Register all the task's device ISR in the IRQ manager
ISR will be executed in thread mode, in the task global context, but
with a dedicated stack and local autonomous context for save/restore,
to support preemption by IRQ.
\ brief Register all the task ' s device ISR in the IRQ manager ISR will be executed in thread mode in the task global context but with a dedicated stack and local autonomous context for save / restore to support preemption by IRQ .
uint8_t dev_register_handlers(e_device_id dev_id, e_task_id task_id)
{
    if (device_tab[dev_id].status == DEV_STATE_REGISTERED) {
        KERNLOG(DBG_ERR, "dev_register_handlers(): status already set as DEV_STATE_REGISTERED\n");
        return 1;
    }
    for (int i = 0; i < device_tab[dev_id].udev.irq_num; ++i) {
        if (is_interrupt_already_used(device_tab[dev_id].udev.irqs[i].irq)) {
            KERNLOG(DBG_ERR,
                "registering irq handler 0x%x for irq %d fails. This irq is already set\n",
                device_tab[dev_id].udev.irqs[i].handler,
                device_tab[dev_id].udev.irqs[i].irq);
            return 1;
        } else {
            set_interrupt_handler(device_tab[dev_id].udev.irqs[i].irq,
                device_tab[dev_id].udev.irqs[i].handler, task_id, dev_id);
        }
    }
    return 0;
}
uint8_t dev_register_handlers ( e_device_id dev_id , e_task_id task_id ) { if ( device_tab [ dev_id ] . status == DEV_STATE_REGISTERED ) { KERNLOG ( DBG_ERR , " \n " ) ; return 1 ; } for ( int i = 0 ; i < device_tab [ dev_id ] . udev . irq_num ; ++ i ) { if ( is_interrupt_already_used ( device_tab [ dev_id ] . udev . irqs [ i ] . irq ) ) { KERNLOG ( DBG_ERR , " \n " , device_tab [ dev_id ] . udev . irqs [ i ] . handler , device_tab [ dev_id ] . udev . irqs [ i ] . irq ) ; return 1 ; } else { set_interrupt_handler ( device_tab [ dev_id ] . udev . irqs [ i ] . irq , device_tab [ dev_id ] . udev . irqs [ i ] . handler , task_id , dev_id ) ; } } return 0 ; }
\brief Register all the task's device ISR in the IRQ manager
 ISR will be executed in thread mode, in the task global context, but
 with a dedicated stack and local autonomous context for save/restore,
 to support preemption by IRQ.
\ brief Register all the task ' s device ISR in the IRQ manager ISR will be executed in thread mode in the task global context but with a dedicated stack and local autonomous context for save / restore to support preemption by IRQ .
/* Checking if there is not already a user IRQ handler */