Beispiel #1
0
void SYS_TMR_Deinitialize ( SYS_MODULE_OBJ object )
{
    int ix;

    // we're up and running
    // make sure no new clients are accepted
    _UserGblLock();

    // now kill all clients

    DRV_TMR_Stop(sSysTmrObject.driverHandle);
    DRV_TMR_Alarm16BitDeregister ( sSysTmrObject.driverHandle);

    SYS_TMR_CLIENT_OBJECT* pClient = sClientObjects + 0;
    for ( ix = 0; ix < sizeof(sClientObjects)/sizeof(*sClientObjects); ix++, pClient++ )
    {
        pClient->isrEnable = 0;
        if ( pClient->currState != SYS_TMR_CLIENT_FREE)
        {
            _SYS_TMR_ClientDelete(pClient);
        }
    }

    _UserGblLockDelete();

    sSysTmrObject.status = SYS_STATUS_UNINITIALIZED;

} 
Beispiel #2
0
void SYS_TMR_Deinitialize ( SYS_MODULE_OBJ object )
{
    int ix;

    if(!_SYS_TMR_ObjectCheck(object))
    {
        return;
    }

    // we're up and running
    // make sure no new clients are accepted
    _UserGblLock();

    // now kill all clients
    if ( sSysTmrObject.driverHandle != 0 && sSysTmrObject.driverHandle != DRV_HANDLE_INVALID )
    { 
        DRV_TMR_Close(sSysTmrObject.driverHandle);
        sSysTmrObject.driverHandle = 0;
    }

    // release all clients
    SYS_TMR_CLIENT_OBJECT* pClient = sClientObjects + 0;
    for ( ix = 0; ix < sizeof(sClientObjects)/sizeof(*sClientObjects); ix++, pClient++ )
    {
        pClient->isrEnable = 0;
        if ( pClient->currState != SYS_TMR_CLIENT_FREE)
        {
            _SYS_TMR_ClientDelete(pClient);
        }
    }

    _UserGblLockDelete();

    sSysTmrObject.status = SYS_STATUS_UNINITIALIZED;

}