当前位置: 首页>>代码示例>>C++>>正文


C++ TINYCLR_HEADER函数代码示例

本文整理汇总了C++中TINYCLR_HEADER函数的典型用法代码示例。如果您正苦于以下问题:C++ TINYCLR_HEADER函数的具体用法?C++ TINYCLR_HEADER怎么用?C++ TINYCLR_HEADER使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了TINYCLR_HEADER函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: NATIVE_PROFILE_CLR_NETWORK

HRESULT Library_spot_net_security_native_Microsoft_SPOT_Net_Security_SslNative::DataAvailable___STATIC__I4__OBJECT( CLR_RT_StackFrame& stack )
{
    NATIVE_PROFILE_CLR_NETWORK();
    TINYCLR_HEADER();

    CLR_RT_HeapBlock* socket = stack.Arg0().Dereference();
    int       result;    
    CLR_INT32 handle;

    FAULT_ON_NULL(socket);

    handle = socket[ Library_spot_net_native_Microsoft_SPOT_Net_SocketNative::FIELD__m_Handle ].NumericByRef().s4;

    result = SSL_DataAvailable( handle );

    // ThrowOnError expects anything other than 0 to be a failure - so return 0 if we don't have an error
    TINYCLR_CHECK_HRESULT(ThrowOnError( stack, result >= 0 ? 0 : result ));

    stack.SetResult_I4( result );

    TINYCLR_NOCLEANUP();    
}
开发者ID:EddieGarmon,项目名称:netduino-netmf,代码行数:22,代码来源:spot_net_security_native_Microsoft_SPOT_Net_Security_SslNative.cpp

示例2: NATIVE_PROFILE_CLR_HARDWARE

HRESULT Library_spot_hardware_native_Microsoft_SPOT_Hardware_Port::Read___BOOLEAN( CLR_RT_StackFrame& stack )
{
    NATIVE_PROFILE_CLR_HARDWARE();
    TINYCLR_HEADER();

    CLR_UINT32 state;
        
    CLR_RT_HeapBlock* pThis = stack.This();  FAULT_ON_NULL(pThis);
    
    if(pThis[ Library_spot_hardware_native_Microsoft_SPOT_Hardware_NativeEventDispatcher::FIELD__m_disposed ].NumericByRef().s1 != 0)
    {
        TINYCLR_SET_AND_LEAVE(CLR_E_OBJECT_DISPOSED);
    }
    
    // Read state from Hardware
    state = ::CPU_GPIO_GetPinState( pThis[ FIELD__m_portId ].NumericByRefConst().u4 );
    
    // Return value to the managed application.
    stack.SetResult_Boolean( state == 0 ? false : true ) ;
    
    TINYCLR_NOCLEANUP();
}
开发者ID:AustinWise,项目名称:Netduino-Micro-Framework,代码行数:22,代码来源:spot_hardware_native_Microsoft_SPOT_Hardware_Port.cpp

示例3: NATIVE_PROFILE_CLR_MESSAGING

HRESULT Library_spot_native_Microsoft_SPOT_Messaging_EndPoint::_ctor___VOID__mscorlibSystemType__U4( CLR_RT_StackFrame& stack )
{
    NATIVE_PROFILE_CLR_MESSAGING();
    TINYCLR_HEADER();

    CLR_RT_HeapBlock*               pThis = stack.This(); 
    CLR_RT_HeapBlock_EndPoint::Port port;
    CLR_RT_HeapBlock_EndPoint*      ep;
    CLR_RT_HeapBlock*               hbType = stack.Arg1().Dereference();

    FAULT_ON_NULL(pThis);
    FAULT_ON_NULL(hbType);

    if(CLR_RT_ReflectionDef_Index::Convert( *hbType, port.m_type ) == false) TINYCLR_SET_AND_LEAVE(CLR_E_NULL_REFERENCE);
    port.m_id = stack.Arg2().NumericByRefConst().u4;

    ep = CLR_RT_HeapBlock_EndPoint::FindEndPoint( port ); if(ep) TINYCLR_SET_AND_LEAVE(CLR_E_BUSY);

    TINYCLR_SET_AND_LEAVE(CLR_RT_HeapBlock_EndPoint::CreateInstance( port, *pThis, pThis[ FIELD__m_handle ] ));

    TINYCLR_NOCLEANUP();
}
开发者ID:EddieGarmon,项目名称:netduino-netmf,代码行数:22,代码来源:spot_native_Microsoft_SPOT_Messaging_EndPoint.cpp

示例4: TINYCLR_HEADER

HRESULT Library_spot_Time_native_Microsoft_SPOT_Time_TimeService::get_Settings___STATIC__MicrosoftSPOTTimeTimeServiceSettings( CLR_RT_StackFrame& stack )
{
    TINYCLR_HEADER(); 

    TimeService_Settings    settings;
    CLR_RT_HeapBlock&       top = stack.PushValueAndClear();
    CLR_RT_HeapBlock*       managedSettings = NULL;

    TINYCLR_CHECK_HRESULT(TimeService_LoadSettings(&settings));    

    TINYCLR_CHECK_HRESULT(g_CLR_RT_ExecutionEngine.NewObjectFromIndex( top, g_CLR_RT_WellKnownTypes.m_TimeServiceSettings ));
    managedSettings = top.Dereference();

    managedSettings[ ManagedSettings::FIELD__PrimaryServerIP     ].SetInteger( settings.PrimaryServerIP );
    managedSettings[ ManagedSettings::FIELD__AlternateServerIP   ].SetInteger( settings.AlternateServerIP );
    managedSettings[ ManagedSettings::FIELD__RefreshTime         ].SetInteger( settings.RefreshTime );
    managedSettings[ ManagedSettings::FIELD__Tolerance           ].SetInteger( settings.Tolerance );
    managedSettings[ ManagedSettings::FIELD__ForceSyncAtWakeUp   ].SetBoolean( 0 != (settings.Flags & TimeService_Settings_Flags_ForceSyncAtWakeUp) );
    managedSettings[ ManagedSettings::FIELD__AutoDayLightSavings ].SetBoolean( 0 != (settings.Flags & TimeService_Settings_Flags_AutoDST) );

    TINYCLR_NOCLEANUP();
}
开发者ID:EddieGarmon,项目名称:netduino-netmf,代码行数:22,代码来源:spot_Time_native_Microsoft_SPOT_Time_TimeService.cpp

示例5: TINYCLR_HEADER

HRESULT Library_spot_native_Microsoft_SPOT_CryptoState::LoadAsymmetricKey( CLR_RT_StackFrame& stack )
{
    TINYCLR_HEADER();

    CLR_RT_HeapBlock*       pThis;
    CLR_RT_HeapBlock_Array* array;

    pThis = stack.This(); FAULT_ON_NULL(pThis);

    //
    // Init RSA key.
    //
    array = pThis[ Library_spot_native_Microsoft_SPOT_Cryptography_Key_RSA::FIELD__m_modulus ].DereferenceArray(); FAULT_ON_NULL(array);
    memcpy( &m_keyAsymmetric.module, array->GetFirstElement(), sizeof(m_keyAsymmetric.module) );

    array = pThis[ Library_spot_native_Microsoft_SPOT_Cryptography_Key_RSA::FIELD__m_exponent ].DereferenceArray(); FAULT_ON_NULL(array);
    memcpy( &m_keyAsymmetric.exponent, array->GetFirstElement(), sizeof(m_keyAsymmetric.exponent) );

    m_keyAsymmetric.exponent_len = RSA_KEY_SIZE_BYTES / sizeof(DWORD);

    TINYCLR_NOCLEANUP();
}
开发者ID:Wampamba-Nooh,项目名称:MicroFrameworkSDK-Mono,代码行数:22,代码来源:spot_native_Microsoft_SPOT_Cryptography_Key.cpp

示例6: NATIVE_PROFILE_CLR_CORE

HRESULT Library_corlib_native_System_RuntimeType::GetName( CLR_RT_HeapBlock& arg, bool fFullName, CLR_RT_HeapBlock& res )
{
    NATIVE_PROFILE_CLR_CORE();
    TINYCLR_HEADER();

    CLR_RT_TypeDef_Instance td;
    CLR_UINT32              levels;
    char                    rgBuffer[ 256 ];
    LPSTR                   szBuffer;
    size_t                  iBuffer;

    TINYCLR_CHECK_HRESULT(GetTypeDescriptor( arg, td, &levels ));
    
    szBuffer = rgBuffer;
    iBuffer  = MAXSTRLEN(rgBuffer);

    TINYCLR_CHECK_HRESULT(g_CLR_RT_TypeSystem.BuildTypeName( td, szBuffer, iBuffer, fFullName ? CLR_RT_TypeSystem::TYPENAME_FLAGS_FULL : 0, levels ));

    TINYCLR_SET_AND_LEAVE(CLR_RT_HeapBlock_String::CreateInstance( res, rgBuffer ));

    TINYCLR_NOCLEANUP();
}
开发者ID:prabby,项目名称:miniclr,代码行数:22,代码来源:corlib_native_System_RuntimeType.cpp

示例7: NATIVE_PROFILE_CLR_CORE

HRESULT Library_corlib_native_System_BitConverter::GetBytes___STATIC__SZARRAY_U1__R8(CLR_RT_StackFrame& stack)
{
	NATIVE_PROFILE_CLR_CORE();
	TINYCLR_HEADER();

#if !defined(TINYCLR_EMULATED_FLOATINGPOINT)
	double input = stack.Arg0().NumericByRefConst().r8;
#else
	CLR_INT64 input = stack.Arg0().NumericByRefConst().r8;
#endif

	TINYCLR_CHECK_HRESULT(CLR_RT_HeapBlock_Array::CreateInstance(stack.PushValueAndClear(), 8, g_CLR_RT_WellKnownTypes.m_UInt8));
	{
		BYTE* p = stack.TopValue().DereferenceArray()->GetFirstElement();
#if !defined(TINYCLR_EMULATED_FLOATINGPOINT)
		*reinterpret_cast<double*>(p) = input;
#else
		*reinterpret_cast<CLR_INT64*>(p) = input;
#endif
	}
	TINYCLR_NOCLEANUP();
}
开发者ID:AustinWise,项目名称:Netduino-Micro-Framework,代码行数:22,代码来源:corlib_native_System_BitConverter.cpp

示例8: NATIVE_PROFILE_CLR_MESSAGING

HRESULT Library_spot_native_Microsoft_SPOT_Messaging_EndPoint::ReplyRaw___VOID__MicrosoftSPOTMessagingMessage__SZARRAY_U1( CLR_RT_StackFrame& stack )
{
    NATIVE_PROFILE_CLR_MESSAGING();
    TINYCLR_HEADER();

    CLR_RT_HeapBlock*                            pThis;
    CLR_RT_HeapBlock*                            pMsg;
    CLR_RT_HeapBlock_Array*                      pData;
    CLR_RT_HeapBlock_EndPoint*                   ep;
    CLR_Messaging_Commands::Messaging_Reply*     rpc = NULL;
    CLR_UINT32                                   len;

    pThis = stack.This()                   ; FAULT_ON_NULL(pThis);
    pMsg  = stack.Arg1().Dereference()     ; FAULT_ON_NULL(pMsg );
    pData = stack.Arg2().DereferenceArray(); FAULT_ON_NULL(pData);

    TINYCLR_CHECK_HRESULT(CLR_RT_HeapBlock_EndPoint::ExtractInstance( pThis[ FIELD__m_handle ], ep ));

    len = sizeof(CLR_RT_HeapBlock_EndPoint::Address) + pData->m_numOfElements;
    rpc = (CLR_Messaging_Commands::Messaging_Reply*)CLR_RT_Memory::Allocate( len ); CHECK_ALLOCATION(rpc);

    rpc->m_addr.m_seq         = pMsg[ Library_spot_native_Microsoft_SPOT_Messaging_Message::FIELD__m_seq      ].NumericByRefConst  ().u4;
    rpc->m_addr.m_to          = ep->m_addr;
    rpc->m_addr.m_from.m_type = pMsg[ Library_spot_native_Microsoft_SPOT_Messaging_Message::FIELD__m_selector ].ReflectionDataConst().GetTypeHash();
    rpc->m_addr.m_from.m_id   = pMsg[ Library_spot_native_Microsoft_SPOT_Messaging_Message::FIELD__m_id       ].NumericByRefConst  ().u4;

    memcpy( rpc->m_data, pData->GetFirstElement(), pData->m_numOfElements );

    CLR_EE_MSG_EVENT_RPC(CLR_Messaging_Commands::c_Messaging_Reply,len,rpc,WP_Flags::c_NonCritical);

    TINYCLR_CLEANUP();

    if(rpc)
    {
        CLR_RT_Memory::Release( rpc );
    }

    TINYCLR_CLEANUP_END();
}
开发者ID:prabby,项目名称:miniclr,代码行数:39,代码来源:spot_native_Microsoft_SPOT_Messaging_EndPoint.cpp

示例9: NATIVE_PROFILE_CLR_IO

HRESULT Library_spot_io_native_Microsoft_SPOT_IO_NativeFindFile::GetFileInfo___STATIC__MicrosoftSPOTIONativeFileInfo__STRING( CLR_RT_StackFrame& stack )
{
    NATIVE_PROFILE_CLR_IO();
    TINYCLR_HEADER();

    FS_FILEINFO                  fileInfo;
    BOOL                         found;
    UnicodeString                pathW;
    FileSystemVolume*            driver;

    CLR_RT_HeapBlock&            top = stack.PushValueAndClear();

    TINYCLR_CHECK_HRESULT(Library_spot_io_native_Microsoft_SPOT_IO_NativeIO::FindVolume( stack.Arg0(), driver, pathW ));

    TINYCLR_CHECK_HRESULT(driver->GetFileInfo( pathW, &fileInfo, &found ));

    if(found)
    {
        CLR_RT_HeapBlock* managedFi;

        TINYCLR_CHECK_HRESULT(g_CLR_RT_ExecutionEngine.NewObjectFromIndex( top, g_CLR_RT_WellKnownTypes.m_NativeFileInfo ));

        managedFi = top.Dereference();

        managedFi[ Library_spot_io_native_Microsoft_SPOT_IO_NativeFileInfo::FIELD__Attributes     ].SetInteger( (CLR_UINT32)fileInfo.Attributes );
        managedFi[ Library_spot_io_native_Microsoft_SPOT_IO_NativeFileInfo::FIELD__CreationTime   ].SetInteger( (CLR_INT64)fileInfo.CreationTime );
        managedFi[ Library_spot_io_native_Microsoft_SPOT_IO_NativeFileInfo::FIELD__LastAccessTime ].SetInteger( (CLR_INT64)fileInfo.LastAccessTime );
        managedFi[ Library_spot_io_native_Microsoft_SPOT_IO_NativeFileInfo::FIELD__LastWriteTime  ].SetInteger( (CLR_INT64)fileInfo.LastWriteTime );
        managedFi[ Library_spot_io_native_Microsoft_SPOT_IO_NativeFileInfo::FIELD__Size           ].SetInteger( (CLR_INT64)fileInfo.Size );
        managedFi[ Library_spot_io_native_Microsoft_SPOT_IO_NativeFileInfo::FIELD__FileName       ].SetObjectReference( NULL );
    }
    else
    {
        top.SetObjectReference( NULL );
    }

    TINYCLR_NOCLEANUP();
}
开发者ID:AustinWise,项目名称:Netduino-Micro-Framework,代码行数:38,代码来源:spot_io_native_Microsoft_SPOT_IO_NativeFindFile.cpp

示例10: TINYCLR_HEADER

HRESULT Library_security_pkcs11_native_Microsoft_SPOT_Cryptoki_Cryptoki::GetSlotsInternal___STATIC__SZARRAY_MicrosoftSPOTCryptokiSlot( CLR_RT_StackFrame& stack )
{
    TINYCLR_HEADER();

    CK_ULONG                i;
    CK_SLOT_ID              slots[NETMF_CRYPTOKI_MAX_SLOTS];
    CK_ULONG                count = NETMF_CRYPTOKI_MAX_SLOTS;
    CLR_RT_HeapBlock_Array* pSlots;
    CLR_RT_HeapBlock        ref;
    CLR_RT_HeapBlock*       pSlotRef;

    CRYPTOKI_CHECK_RESULT(stack, C_GetSlotList(CK_FALSE, slots, &count));

    TINYCLR_CHECK_HRESULT(CLR_RT_HeapBlock_Array::CreateInstance(ref, (CLR_UINT32)count, g_CLR_RT_WellKnownTypes.m_CryptokiSlot));

    pSlots = ref.DereferenceArray();

    pSlotRef = (CLR_RT_HeapBlock*)pSlots->GetFirstElement();
            
    for(i=0; i<count; i++)
    {
        CLR_RT_HeapBlock* pSlot;
        
        TINYCLR_CHECK_HRESULT(g_CLR_RT_ExecutionEngine.NewObjectFromIndex( pSlotRef[i], g_CLR_RT_WellKnownTypes.m_CryptokiSlot ));

        pSlot = pSlotRef[i].Dereference();
      
        pSlot[Library_security_pkcs11_native_Microsoft_SPOT_Cryptoki_Slot::FIELD__m_slotIndex    ].SetInteger        ((CLR_INT32)slots[i]);
        pSlot[Library_security_pkcs11_native_Microsoft_SPOT_Cryptoki_Slot::FIELD__m_disposed     ].SetBoolean        (false              );
        pSlot[Library_security_pkcs11_native_Microsoft_SPOT_Cryptoki_Slot::FIELD__m_evtDispatcher].SetObjectReference(NULL               );
        pSlot[Library_security_pkcs11_native_Microsoft_SPOT_Cryptoki_Slot::FIELD__m_slotEvent    ].SetObjectReference(NULL               );
        pSlot[Library_security_pkcs11_native_Microsoft_SPOT_Cryptoki_Slot::FIELD__m_slotInfo     ].SetObjectReference(NULL               );
    }

    stack.SetResult_Object(pSlots);

    TINYCLR_NOCLEANUP();
}
开发者ID:EddieGarmon,项目名称:netduino-netmf,代码行数:38,代码来源:security_pkcs11_native_Microsoft_SPOT_Cryptoki_Cryptoki.cpp

示例11: TINYCLR_HEADER

HRESULT Library_security_pkcs11_native_Microsoft_SPOT_Cryptoki_CryptokiSign::SignInit___VOID__MicrosoftSPOTCryptokiSession__MicrosoftSPOTCryptokiMechanism__SystemSecurityCryptographyCryptoKey( CLR_RT_StackFrame& stack )
{
    TINYCLR_HEADER();

    CLR_RT_HeapBlock*       pSession   = stack.Arg1().Dereference();
    CLR_RT_HeapBlock*       pMech      = stack.Arg2().Dereference();
    CLR_RT_HeapBlock*       pKeyHandle = stack.Arg3().Dereference();
    CLR_RT_HeapBlock_Array* pArrParam;
    CK_MECHANISM            mech;
    CK_OBJECT_HANDLE        hKey;
    CK_SESSION_HANDLE       hSession;

    FAULT_ON_NULL_ARG(pSession);
    FAULT_ON_NULL_ARG(pMech);

    hSession = (CK_SESSION_HANDLE)pSession[Library_security_pkcs11_native_Microsoft_SPOT_Cryptoki_Session::FIELD__m_handle].NumericByRef().s4;

    mech.mechanism = pMech[Library_security_pkcs11_native_Microsoft_SPOT_Cryptoki_Mechanism::FIELD__Type].NumericByRef().u4;

    pArrParam = pMech[Library_security_pkcs11_native_Microsoft_SPOT_Cryptoki_Mechanism::FIELD__Parameter].DereferenceArray();

    if(pArrParam != NULL && pArrParam->m_numOfElements > 0)
    {
        mech.pParameter     = pArrParam->GetFirstElement();
        mech.ulParameterLen = pArrParam->m_numOfElements;
    }
    else
    {
        mech.pParameter = NULL;
        mech.ulParameterLen = 0;
    }

    hKey = (CK_OBJECT_HANDLE)pKeyHandle[Library_security_pkcs11_native_Microsoft_SPOT_Cryptoki_CryptokiObject::FIELD__m_handle].NumericByRef().s4;

    CRYPTOKI_CHECK_RESULT(stack, C_SignInit(hSession, &mech, hKey));

    TINYCLR_NOCLEANUP();
}
开发者ID:koson,项目名称:.NETMF_for_LPC17xx,代码行数:38,代码来源:security_pkcs11_native_Microsoft_SPOT_Cryptoki_CryptokiSign.cpp

示例12: TINYCLR_HEADER

HRESULT FAT_FINDFILES::FindNext( FS_FILEINFO *fi, BOOL *fileFound )
{
    TINYCLR_HEADER();
    
    FAT_FILE fileInfo;
    FAT_Directory* dirEntry;
    
    if(!fi || !fileFound)
    {
        TINYCLR_SET_AND_LEAVE(CLR_E_FILE_IO);
    }

    do
    {
        if(fileInfo.Parse( m_logicDisk, &m_entryEnum ) != S_OK)
        {
            *fileFound = FALSE;
            TINYCLR_SET_AND_LEAVE(S_OK);
        }
        
        dirEntry = fileInfo.GetDirectoryEntry();

        if(!dirEntry) TINYCLR_SET_AND_LEAVE(CLR_E_FILE_IO);
    }
    while(dirEntry->DIR_Name[0] == '.' || dirEntry->DIR_Attr == ATTR_VOLUME_ID); // Skip the "." and ".." and the Volume_ID entries

    fi->Attributes     = dirEntry->DIR_Attr;
    fi->Size           = dirEntry->Get_DIR_FileSize();
    fi->CreationTime   = FAT_Utility::FATTimeToTicks( dirEntry->Get_DIR_CrtDate()   , dirEntry->Get_DIR_CrtTime(), dirEntry->DIR_CrtTimeTenth );
    fi->LastAccessTime = FAT_Utility::FATTimeToTicks( dirEntry->Get_DIR_LstAccDate(), 0                    , 0                          );
    fi->LastWriteTime  = FAT_Utility::FATTimeToTicks( dirEntry->Get_DIR_WrtDate()   , dirEntry->Get_DIR_WrtTime(), 0                          );

    TINYCLR_CHECK_HRESULT(fileInfo.CopyFileName( (LPWSTR)(fi->FileName), fi->FileNameSize ));

    *fileFound = TRUE;

    TINYCLR_NOCLEANUP();
}
开发者ID:Sorcha,项目名称:NETMF-LPC,代码行数:38,代码来源:FAT_FS.cpp

示例13: NATIVE_PROFILE_CLR_CORE

HRESULT Library_corlib_native_System_Threading_Monitor::Enter___STATIC__VOID__OBJECT( CLR_RT_StackFrame& stack )
{
    NATIVE_PROFILE_CLR_CORE();
    TINYCLR_HEADER();

    CLR_RT_StackFrame* caller = NULL;
        
    if(stack.Arg0().Dereference() == NULL)
    {
        TINYCLR_SET_AND_LEAVE(CLR_E_ARGUMENT_NULL);
    }
    
    switch(stack.m_customState)
    {
    case 0:
        {
            caller = stack.Caller(); FAULT_ON_NULL(caller); // We need to set the constraint on the caller, not on us...

            hr = g_CLR_RT_ExecutionEngine.LockObject( stack.Arg0(), caller->m_owningSubThread, TIMEOUT_INFINITE, false );
            if(hr == CLR_E_THREAD_WAITING)
            {
                stack.m_customState = 1;
            }

            TINYCLR_LEAVE();
        }
        break;

    case 1:
        TINYCLR_SET_AND_LEAVE(S_OK);
        break;

    default:
        TINYCLR_SET_AND_LEAVE(CLR_E_FAIL);
    }

    TINYCLR_NOCLEANUP();
}
开发者ID:EddieGarmon,项目名称:netduino-netmf,代码行数:38,代码来源:corlib_native_System_Threading_Monitor.cpp

示例14: Microsoft_SPOT_Hardware_InterruptPort_EnableInterrupt

static HRESULT Microsoft_SPOT_Hardware_InterruptPort_EnableInterrupt( CLR_RT_HeapBlock* pThis, CLR_RT_HeapBlock_NativeEventDispatcher* pIOPort )
{    
    TINYCLR_HEADER();
    {
        CLR_INT32 &flags              = pThis[ Library_spot_hardware_native_Microsoft_SPOT_Hardware_Port::FIELD__m_flags              ].NumericByRef().s4;
        CLR_UINT32  portId            = pThis[ Library_spot_hardware_native_Microsoft_SPOT_Hardware_Port::FIELD__m_portId             ].NumericByRef().u4;
        CLR_INT32  glitchFilterEnable = pThis[ Library_spot_hardware_native_Microsoft_SPOT_Hardware_Port::FIELD__m_glitchFilterEnable ].NumericByRef().s4;
        
        GPIO_RESISTOR  resistorMode  = (GPIO_RESISTOR)pThis[ Library_spot_hardware_native_Microsoft_SPOT_Hardware_Port::FIELD__m_resistorMode      ].NumericByRef().s4;
        GPIO_INT_EDGE  interruptMode = (GPIO_INT_EDGE)pThis[ Library_spot_hardware_native_Microsoft_SPOT_Hardware_Port::FIELD__m_interruptMode     ].NumericByRef().s4;
        
        
        if(flags & GPIO_PortParams::c_Disposed)
        {
            TINYCLR_SET_AND_LEAVE(CLR_E_PIN_DEAD);
        }

        if(flags & GPIO_PortParams::c_InterruptDisabled)
        {   
            flags &= ~GPIO_PortParams::c_InterruptDisabled;

            if(
                !::CPU_GPIO_EnableInputPin2(
                                             portId,
                                             glitchFilterEnable,
                                             Library_spot_hardware_native_Microsoft_SPOT_Hardware_Port::IsrProcedure,
                                             pIOPort,
                                             interruptMode,
                                             resistorMode
                                           )
              )
            {
                TINYCLR_SET_AND_LEAVE(CLR_E_INVALID_PARAMETER);
            }
        }
    }
    TINYCLR_NOCLEANUP();
}
开发者ID:AustinWise,项目名称:Netduino-Micro-Framework,代码行数:38,代码来源:spot_hardware_native_Microsoft_SPOT_Hardware_InterruptPort.cpp

示例15: TINYCLR_HEADER

HRESULT Library_spot_hardware_native_Microsoft_SPOT_Hardware_NativeEventDispatcher::Dispose___VOID__BOOLEAN( CLR_RT_StackFrame& stack )
{
    TINYCLR_HEADER();
        
    CLR_RT_HeapBlock_NativeEventDispatcher *pNativeDisp = NULL;
    
    CLR_RT_HeapBlock*  pThis = stack.This();  FAULT_ON_NULL(pThis);
    
    TINYCLR_CHECK_HRESULT(GetEventDispatcher( stack, pNativeDisp ));
    
    // Cleanup the HAL queue from the instance of assiciated CLR_RT_HeapBlock_NativeEventDispatcher 
    pNativeDisp->RemoveFromHALQueue();
    
    // Calls driver to enable interrupts.  Consider that there could be no driver 
    // associated to this object so check that the driver methods are set 
    // we will be tolerant in this case and not throw any exception
    if(pNativeDisp->m_DriverMethods != NULL)
    {
        TINYCLR_CHECK_HRESULT(pNativeDisp->m_DriverMethods->m_CleanupProc( pNativeDisp )); 
    }
    
    TINYCLR_NOCLEANUP();
}
开发者ID:AustinWise,项目名称:Netduino-Micro-Framework,代码行数:23,代码来源:spot_hardware_native_Microsoft_SPOT_Hardware_NativeEventDispatcher_mshl.cpp


注:本文中的TINYCLR_HEADER函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。