src/C/devices.c
e_device_id dev_get_free_device_slot(e_task_id task_id, device_t *udev)
{
    for (uint8_t i = ID_DEV1; i < ID_DEV_MAX; ++i) {
        if (device_tab[i].status == DEV_STATE_NONE) {
            device_tab[i].task_id = task_id;
            device_tab[i].status  = DEV_STATE_RESERVED;
            device_tab[i].udev    = *udev;
            return i;
        }
    }
    return ID_DEV_UNUSED;
}
/************************************************************************
 * Device slotting functions
 * These functions manage the devices kernel vector
 ***********************************************************************/
Device slotting functions
These functions manage the devices kernel vector
Device slotting functions These functions manage the devices kernel vector
e_device_id dev_get_free_device_slot(e_task_id task_id, device_t *udev)
{
    for (uint8_t i = ID_DEV1; i < ID_DEV_MAX; ++i) {
        if (device_tab[i].status == DEV_STATE_NONE) {
            device_tab[i].task_id = task_id;
            device_tab[i].status  = DEV_STATE_RESERVED;
            device_tab[i].udev    = *udev;
            return i;
        }
    }
    return ID_DEV_UNUSED;
}
e_device_id dev_get_free_device_slot ( e_task_id task_id , device_t * udev ) { for ( uint8_t i = ID_DEV1 ; i < ID_DEV_MAX ; ++ i ) { if ( device_tab [ i ] . status == DEV_STATE_NONE ) { device_tab [ i ] . task_id = task_id ; device_tab [ i ] . status = DEV_STATE_RESERVED ; device_tab [ i ] . udev = * udev ; return i ; } } return ID_DEV_UNUSED ; }
Device slotting functions
 These functions manage the devices kernel vector
Device slotting functions These functions manage the devices kernel vector