亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? coffloader.cpp

?? dsp2808控制的代碼
?? CPP
?? 第 1 頁 / 共 4 頁
字號:
/*
 *  Copyright 2003 by Spectrum Digital Incorporated.
 *  All rights reserved. Property of Spectrum Digital Incorporated.
 */

// CoffLoader.cpp
#include "stdafx.h"
#include "SDLoader.h"
#include "SDLoaderDlg.h"

/* ==============================
   Valid register names and size
    {"PC",       sizeof(TREG_32)
    {"SP",       sizeof(TREG_16)
    {"ACC",      sizeof(TREG_32)
    {"P",        sizeof(TREG_32)
    {"T",        sizeof(TREG_16)
    {"ST0",      sizeof(TREG_16)
    {"ST1",      sizeof(TREG_16)
    {"AR0",      sizeof(TREG_16)
    {"AR1",      sizeof(TREG_16)
    {"AR2",      sizeof(TREG_16)
    {"AR3",      sizeof(TREG_16)
    {"AR4",      sizeof(TREG_16)
    {"AR5",      sizeof(TREG_16)
    {"XAR6",     sizeof(TREG_32)
    {"XAR7",     sizeof(TREG_32)
    {"IER",      sizeof(TREG_16)
    {"DP",       sizeof(TREG_16)
    {"IFR",      sizeof(TREG_16)
    {"DBGIER",   sizeof(TREG_16)
    // Added June 2004.
    {"DBGIM",    sizeof(TREG_16)
    {"HPI",      sizeof(TREG_16)
    {"PREEMPT",  sizeof(TREG_16)
    // This is little hack to get C28xx XARx regs.  The ids
    // still match C27xx but low level driver will return 32
    // bit value
    {"XAR0",     sizeof(TREG_32)
    {"XAR1",     sizeof(TREG_32)
    {"XAR2",     sizeof(TREG_32)
    {"XAR3",     sizeof(TREG_32)
    {"XAR4",     sizeof(TREG_32)
    {"XAR5",     sizeof(TREG_32)
*/

/*F***************************************************************************
* NAME:  Constructor
*
* DESCRIPTION:  Do basic initialization here.
*
*
*F***************************************************************************/
CoffLoader::CoffLoader( )               
{
    m_pSdti_Intf      = NULL; 
    m_Sdti_Hndl       = NULL; 
    m_isConnected     = FALSE;

    m_coffHndl        = NULL;         
    m_coffLib         = NULL;  
	m_symlist         = NULL;
    m_swbplist        = NULL;
    m_numSymbols      = 0;

    m_verboseError    = TRUE;
    m_verboseMessage  = TRUE;
    m_SciLoopBack     = FALSE;
    m_CanLoopBack     = FALSE;
    m_I2CLoopBack     = FALSE;

    m_isRealTimeAllowed = FALSE;
}

/*F***************************************************************************
* NAME: Destructor 
*
* DESCRIPTION:  Do cleanup here.  In theory the main code cleans up after
*               itself.  But just in case there is a untested exit path we
*               can catch it here.  Beware clean up has to be done in reverse
*               order.
*
*F***************************************************************************/
CoffLoader::~CoffLoader( ) 
{
    CloseConnection();
}

/*F***************************************************************************
* NAME:   Message( CString MsgString ) 
*
* DESCRIPTION:  
*      This function allows for messages to be posted back to the main dialog
*      window.  Each message string is allocated as a new CString object. This
*      ensures no memory problems when the code load has completed.
*
*F***************************************************************************/
void CoffLoader::Message( CString MsgString )
{
	if( m_verboseMessage == TRUE )
	{
		/* Create a new CString object */ 
		CString * message = new CString( MsgString );

		/* Post the message to the Dialog Window */ 
		m_mainWindow->PostMessage( UWM_ONTHREADMESSAGE, 0, ( LPARAM )message );
	}
}
/*F***************************************************************************
* NAME:   ErrMsg( CString MsgString ) 
*
* DESCRIPTION:  
*      This function allows for erros to be posted back to the main dialog
*      window.  Each message string is allocated as a new CString object. This
*      ensures no memory problems when the code load has completed.
*
*F***************************************************************************/
void CoffLoader::ErrMsg( CString MsgString )
{
	if( m_verboseError == TRUE )
	{
		/* Create a new CString object */ 
		CString * message = new CString( MsgString );

		/* Post the message to the Dialog Window */ 
		m_mainWindow->PostMessage( UWM_ONTHREADMESSAGE, 0, ( LPARAM )message );
	}
}


/*F***************************************************************************
* NAME: OpenConnection( void )    
*
* DESCRIPTION: Open emulation connection
*
*
*F***************************************************************************/
BOOL CoffLoader::OpenConnection( void )
{

    // Just one connection per session
    if( m_isConnected == TRUE )
        return( FALSE );

    // Create SD_TARGET_INTERFACE 
    if ( ! SDTI_GetInterface( ( void** )&m_pSdti_Intf, CSTRING_TO_PCHAR( m_procFamily ) ) )
    {
        ErrMsg( "ERROR \tCannot fetch SD Target Interface for processor type "
                + m_procFamily );
        return( FALSE );
    }

    // Create m_Sdti_Hndl, TMS320C27XX_28XX is the name embedded into the ccs .dvr file.
	// If we specify a name then SDTI will check for valid name.  Else pass NULL and
	// take what you get.
	//
    if ( ! m_pSdti_Intf->pCfg->CreateHndl( &m_Sdti_Hndl,
                                          CSTRING_TO_PCHAR( m_driverPath ),
                                          CSTRING_TO_PCHAR( m_driverName ),
										  "TMS320C27XX_28XX" ))
    {
        ErrMsg( "ERROR \tCannot create a SDTI handle for processor type "
                + m_procFamily + " in driver " + m_driverName );
        return( FALSE );
    }

    // The SetOptions function will inform the drivers on what the
    // board setting is currently being used and which processor on the board
    // the user wants to access.
    //
    // The physical link between computer and target board may vary from a
    // parallel port ( address 0x378 ) to usb ( address 0x540 ).  Each type of link
    // has an associated port address used for emulation.
    //
    // The diverse board configurations require an external board file to be
    // used.  This board file contains the type of processors used and the
    // position of each on the scan chain.
    //
    // To access a single processor on the board, the drivers needs to
    // identified it through the board file's scan chain.  Each processor is
    // designated with a "cpu_#", where # is the position.
    //
    // DevConnectRealtime             (YES/NO)
    // DevRunOnDisconnect             (YES/NO)
    // DevEnableMemoryMapChecking     (YES/NO)
    // DevMaxMemoryBlockSize          (256-2048)
    // DevForceStatusCheck            (YES/NO) 

    // Set emulator port address 
    if ( ! m_pSdti_Intf->pCfg->SetOptions( m_Sdti_Hndl, CSTRING_TO_PCHAR( "EmuPortAddr=" + m_procAddr ) ) )
    {
        ErrMsg( "ERROR \tFailed to Set Option [ EmuPortAddr="
                + m_procAddr + " ]." );
        return( FALSE );
    }

    // Set device board file
    if ( ! m_pSdti_Intf->pCfg->SetOptions( m_Sdti_Hndl, CSTRING_TO_PCHAR( m_BoardFile ) ) )
    {
        ErrMsg( "ERROR \tFailed to Set Option [ DevBoardName="
                  + m_workingDirectory + m_targetPath + m_boardName + " ]." );
        return( FALSE );
    }

    // Set device processor 
    if ( ! m_pSdti_Intf->pCfg->SetOptions( m_Sdti_Hndl, CSTRING_TO_PCHAR( "DevProcName=" + m_procName ) ) )
    {
        ErrMsg( "ERROR \tFailed to Set Option [ DevProcName="
                + m_procName + " ]." );
        return( FALSE );
    }
    // Set the memory block size
    if ( ! m_pSdti_Intf->pCfg->SetOptions( m_Sdti_Hndl, CSTRING_TO_PCHAR( "DevMaxMemoryBlockSize=2048") ) )
    {
        ErrMsg( "ERROR \tFailed to Set Option [ DevProcName="
                + m_procName + " ]." );
        return( FALSE );
    }

    //
    //   Once the configuration settings are complete, the computer
    // can now connect to the processor.  After a successful connection to the
    // processor, all non-configuration functions become available to use.
    // 
    // Connect to target processor 
    if ( ! m_pSdti_Intf->pCfg->Connect( m_Sdti_Hndl ) )
    {
        ErrMsg( "ERROR \tFailed to CONNECT to Target." );
		// Flush error/messages for debug
		while( CheckEvents() ){}
        return( FALSE );
    }
    
    m_isConnected = TRUE;
    return( TRUE );
}

/*F***************************************************************************
* NAME: CloseConnection( void )    
*
* DESCRIPTION: Close emulation connection
*
*
*F***************************************************************************/
BOOL CoffLoader::CloseConnection(void)
{
    // Delete breakpoints if they exists
    if( m_swbplist != NULL ) {
        DeleteSwbpList();
        m_swbplist = NULL;
    }

    // Delete symbols
    if( m_symlist != NULL ) {
		DeleteSymbolList();
		m_symlist = NULL;
	}

	// Close any open handles and free lists if they are still active
	//
    if( (m_coffLib != NULL)	&& ( m_coffHndl != NULL )) {
        m_coffLib->COFFR_FileClose( m_coffHndl );
		m_coffHndl = NULL;
	}

    // Close the emulation connection
	if( (m_pSdti_Intf != NULL ) && ( m_Sdti_Hndl != NULL )) {
        m_pSdti_Intf->pCfg->Disconnect( m_Sdti_Hndl );

        m_pSdti_Intf->pCfg->FreeHndl( m_Sdti_Hndl );
		m_Sdti_Hndl = NULL;

        /* Sleep for 2 second so usb device can disconnect from windows.
         * Windows USB Issue */ 
        Sleep(2000);

	}

    m_isConnected = FALSE;
    return( TRUE );
}

BOOL CoffLoader::CheckConnection(void)
{
    if(     ( m_pSdti_Intf   == NULL )
        ||  ( m_Sdti_Hndl    == NULL )
        ||  ( m_isConnected  == FALSE)) {
        return( FALSE );
    }else {
        return( TRUE );
    }
}
/*F***************************************************************************
* NAME: InitEvent( void )    
*
* DESCRIPTION: Set the status event to a NULL state.
*
*
*F***************************************************************************/
void CoffLoader::InitEvent( void ) 
{	
	m_Evt.EvtId   = 0;
	m_Evt.Taddr   = 0;
	m_Evt.Space   = M_NATURAL;
	m_Evt.Type    = EVT_NONE;
	m_Evt.System  = EVT_SYS_NONE;
	m_Evt.Error   = 0;
}

/*F***************************************************************************
* NAME:  CheckEvents( void )  
*
* DESCRIPTION:  The SDTI interface puts pretty much all status and errors into
*               and event queue.  This is a common place to pull all the events
*               and process they come in.
*
*F***************************************************************************/
BOOL CoffLoader::CheckEvents( void )
{
    BOOL              isEvt;
	
    // Always test for connection to prevent user calling in disconnected
    // state or with NULL handles.
    if( CheckConnection() == FALSE ) {
        return( FALSE );
    }

	InitEvent();

    isEvt = m_pSdti_Intf->pExe->IsEvent( m_Sdti_Hndl, &m_Evt );
    if( isEvt )
    {
		// Event processing flow:
		// 1) Handle error events first
		// 2) Then spurious errors that are do not generate system events.
		//    Generally code mishap.
		// 3) Then handle target events like breakpoints and such

		if( m_Evt.System != EVT_SYS_NONE )
        {
			// 1) System error events

			// If system warning event then do not send error message.
			// These are for internal processing.  Return that we saw
			// an event so that caller can continue processing other
			// events as required.
			if( m_Evt.System == EVT_SYS_WARN )
				return( isEvt );
			else
			{
				// If we have a DISCONNECTED error then return isEvt==FALSE.
				// If you are disconnected you will always get a disconnected
				// error, i.e. an endless loop
				//
				if( m_Evt.Error == CFG_ERR_DISCONNECTED )
					return( FALSE );

    			CString Error;
       
				if( m_Evt.Error > (CFG_ERR_GENERIC -1 ) ) {
					Error.Format( "ERR: SDTI error: Id: %x, Addr: 0x%x, Space: %x, Type: %x, System: 0x%x, Error: %d",
									m_Evt.EvtId, 
									m_Evt.Taddr, 
									m_Evt.Space, 
									m_Evt.Type,
									m_Evt.System, 
									m_Evt.Error );
				}
				else if ( m_Evt.Error < 0 ) {	
                    // Handle the USB connection error special
                    if( m_Evt.Error == -4037 ) {
                        Error.Format( "ERR: USB Error: %d, USB connection not found or in use by another application",
									                       m_Evt.Error );
                    }
                    else {
					    Error.Format( "ERR: OTIS error: Id: %x, Addr: 0x%x, Space: %x, Type: %x, System: 0x%x, Error: %d",
									    m_Evt.EvtId, 
									    m_Evt.Taddr, 
									    m_Evt.Space, 
									    m_Evt.Type,
									    m_Evt.System, 
									    m_Evt.Error );
                    }
				}

				if( !Error.IsEmpty() ) {
					ErrMsg( Error + "\r\n");
				}
			}
        }
		else
		{
	  	    // This should not occur but here for safety
			if( m_Evt.Error )
			{
				// 2) Spurious events

				// If we have a DISCONNECTED error then return isEvt==FALSE.
				// If you are disconnected you will always get a disconnected
				// error, i.e. an endless loop
				//
				if( m_Evt.Error == CFG_ERR_DISCONNECTED )
					return( FALSE );
				else
				{
					switch( m_Evt.Error )
					{
						case CFG_ERR_LIB_HANDLE:
							ErrMsg("ERR: Could not obtain a handle to specified driver");
							break;
						case CFG_ERR_LIB_INTERFACE:
							ErrMsg("ERR: Driver interface is not supported");
							break;
						case CFG_ERR_LIB_VERSION:
							ErrMsg("ERR: Driver version is incorrect");
							break;
						case CFG_ERR_FAMILY:
							ErrMsg("ERR: Processor family is not supported");
							break;
						default:
							ErrMsg("MSG: Execution event detected");
							break;
					}
				}
			}
			else if( m_Evt.Type != EVT_NONE )
			{

				// 3) Target events like breakpoints.  Nothing to do but could
				//    add some messages and stuff.   
   			    CString StopEvent;

                switch( m_Evt.Type )
                {
                    case EVT_HALT:
     			        StopEvent.Format( "Stopped at Addr: 0x%x",m_Evt.Taddr );
                        break;

                    case EVT_SWBP:
     			        StopEvent.Format( "Breakpoint at Addr: 0x%x",m_Evt.Taddr );
                        break;
                    case EVT_HWIAQ:
     			        StopEvent.Format( "Hardware IAQ at Addr: 0x%x",m_Evt.Taddr );
                        break;

                    case EVT_HWDATA:
     			        StopEvent.Format( "Hardware data break at Addr: 0x%x",m_Evt.Taddr );
                        break;
                }
                
          		if( !StopEvent.IsEmpty() ) {
				    Message( StopEvent );
				}

			}
		}
    }

    return( isEvt );
}

/*F***************************************************************************
* NAME:   WaitForHaltEvent( ) 
*
* DESCRIPTION:  Following a run command we can wait for target to halt
*               execution.  If we get a system event then this is probably
*               and error.  In in this case we still break out so that caller
*               can take action.  Otherwise any event other the EVT_NONE will
*               have halted the processor.
*
*F***************************************************************************/
BOOL CoffLoader::WaitForHaltEvent( )
{
	BOOL isEvt = FALSE;
	long  TimeOutInMs = (long)(((m_ExecTimeoutMs+9)/10)*10);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕精品综合| 久久久美女毛片| 成人精品在线视频观看| 亚洲一区二区av在线| 国产偷国产偷亚洲高清人白洁| 欧美午夜理伦三级在线观看| caoporn国产精品| 韩国av一区二区三区四区| 亚洲永久精品国产| 亚洲一区中文在线| 1024成人网| 国产精品色在线| 国产网站一区二区三区| 国产无一区二区| 中文字幕巨乱亚洲| 国产精品乱子久久久久| 久久精品人人爽人人爽| 中文字幕免费不卡在线| 久久精品亚洲一区二区三区浴池| 精品99一区二区| 久久色在线观看| 国产精品福利影院| 亚洲免费在线看| 日韩中文欧美在线| 激情综合色综合久久综合| 精品一区二区久久久| 国产麻豆成人精品| 一本一本大道香蕉久在线精品| 一本久道久久综合中文字幕| 欧美日韩精品系列| 欧美色图天堂网| 日韩欧美亚洲国产另类| 国产欧美视频在线观看| 国产精品久久久久永久免费观看 | 日韩免费性生活视频播放| 日韩精品一区二区三区视频播放| 欧美xxxx老人做受| 日韩毛片在线免费观看| 首页国产丝袜综合| 懂色av一区二区在线播放| 欧美性极品少妇| 久久婷婷国产综合精品青草| 亚洲精品成人少妇| 麻豆成人91精品二区三区| 色综合久久综合| 日韩欧美第一区| 亚洲综合激情另类小说区| 韩国毛片一区二区三区| 欧美日韩一卡二卡三卡| 国产欧美日韩激情| 蜜乳av一区二区| 91久久精品国产91性色tv| 2023国产精品自拍| 美国av一区二区| 欧美浪妇xxxx高跟鞋交| 一区在线播放视频| 国产超碰在线一区| 国产精品毛片高清在线完整版| 亚洲成人精品一区二区| av网站免费线看精品| 国产网站一区二区三区| 美女脱光内衣内裤视频久久网站| 欧洲精品一区二区| 亚洲免费资源在线播放| 99久久综合国产精品| 中文字幕第一区二区| 成人性生交大片免费| 欧美国产精品专区| 成人一区二区在线观看| 国产情人综合久久777777| 国产高清久久久| 国产精品萝li| av在线不卡网| 亚洲三级在线看| 精品视频999| 蜜臀久久久久久久| 日韩免费成人网| 韩国一区二区在线观看| 国产女人水真多18毛片18精品视频| 国产精品一二三四区| 国产精品久99| 欧美在线制服丝袜| 久久福利视频一区二区| 国产色一区二区| 在线精品视频一区二区三四 | 亚洲女爱视频在线| 欧美日韩色一区| 国产一区二区网址| 一区二区三区在线免费| 欧美一区中文字幕| 不卡av电影在线播放| 亚洲国产精品久久久久秋霞影院| 欧美精品乱码久久久久久按摩| 久久精品噜噜噜成人av农村| 欧美经典一区二区| 日韩视频中午一区| 成年人国产精品| 亚洲综合在线视频| 日本一区二区三区高清不卡| 欧美日韩高清不卡| 一本久道中文字幕精品亚洲嫩| 日韩国产欧美视频| 亚洲欧美日韩小说| 久久日韩粉嫩一区二区三区 | 久久网这里都是精品| 欧美日韩在线亚洲一区蜜芽| 国产一区二区日韩精品| 亚洲国产裸拍裸体视频在线观看乱了 | 色婷婷久久久综合中文字幕| 99久久国产免费看| 免费观看30秒视频久久| 国产精品传媒入口麻豆| 欧美激情综合网| 欧美xxxxx牲另类人与| 7777精品伊人久久久大香线蕉的 | 欧美电影一区二区| 色噜噜狠狠色综合中国| av一区二区不卡| 成人性生交大片免费看中文| 国产麻豆成人传媒免费观看| 国产麻豆成人精品| 国产精一区二区三区| 国产精品自拍三区| 国产suv精品一区二区883| 国产福利一区二区| 波多野结衣中文一区| 97se亚洲国产综合自在线不卡| 成人动漫一区二区在线| 国产91对白在线观看九色| av电影在线观看不卡| 99在线精品一区二区三区| 99视频在线精品| 欧美日韩一区二区电影| 91精品视频网| 国产色综合一区| 亚洲理论在线观看| 免费在线看成人av| 国产91精品久久久久久久网曝门| www.成人网.com| 欧美精品一级二级| 国产精品伦理一区二区| 亚洲男人的天堂网| 免费观看成人av| 成人app网站| 日韩欧美国产wwwww| 国产精品久久久久久久浪潮网站| 亚洲宅男天堂在线观看无病毒| 另类成人小视频在线| 成人av在线播放网址| 欧美成人精品高清在线播放| 中文字幕中文字幕一区| 日本欧美一区二区| 色综合视频在线观看| 精品少妇一区二区三区日产乱码| 国产精品剧情在线亚洲| 日本成人在线网站| 欧美日韩国产精选| 中文字幕一区在线观看| 国产毛片精品一区| 欧美一区二区视频观看视频| 亚洲免费观看视频| 不卡高清视频专区| 久久久一区二区三区| 日本中文字幕不卡| 欧美夫妻性生活| 亚洲激情网站免费观看| 成人亚洲精品久久久久软件| www国产成人免费观看视频 深夜成人网| 亚洲va中文字幕| 在线亚洲一区二区| 一区二区三区精品视频在线| 97久久超碰国产精品| 亚洲欧美中日韩| eeuss国产一区二区三区| 国产精品电影一区二区三区| 成人av在线影院| 亚洲日本一区二区| 91国内精品野花午夜精品| 亚洲制服欧美中文字幕中文字幕| 在线亚洲一区二区| 午夜成人在线视频| 精品国产麻豆免费人成网站| 久国产精品韩国三级视频| 欧美精品一区二区在线播放| 国产精品亚洲第一区在线暖暖韩国| 26uuu精品一区二区三区四区在线| 毛片av一区二区三区| 亚洲精品中文在线影院| 欧美色视频在线| 久久国产精品99久久人人澡| 国产精品丝袜一区| 欧美视频中文字幕| 国产一区二区三区视频在线播放| 欧美国产一区在线| 欧美无砖专区一中文字| 免费观看日韩av| 亚洲蜜臀av乱码久久精品蜜桃| 51午夜精品国产| 成人黄色电影在线| 奇米影视在线99精品|