同样可以看一下gel文件中的其他函数:
view plaincopy to clipboardprint?
/*--------------------------------------------------------------*/
/* OnReset() */
/* This function is called by CCS when you do Debug->Resest. */
/* The goal is to put the C6x into a known good state with */
/* respect to cache, edma and interrupts. */
/*--------------------------------------------------------------*/
OnReset( int nErrorCode )
{
init_emif();
}
/*--------------------------------------------------------------*/
/* OnPreFileLoaded() */
/* This function is called automatically when the 'Load Program'*/
/* Menu item is selected. */
/*--------------------------------------------------------------*/
OnPreFileLoaded()
{
/*------------------------------------------------------*/
/* GEL_Reset() is used to deal with the worst case */
/* senario of unknown target state. If for some reason */
/* a reset is not desired upon target connection, */
/* GEL_Reset() may be removed and replaced with */
/* something "less brutal" like a cache initialization */
/* function. */
/*------------------------------------------------------*/
//GEL_Reset();
flush_cache();
IER = 0;
IFR = 0;
init_emif();
}
/*--------------------------------------------------------------*/
/* OnRestart() */
/* This function is called by CCS when you do Debug->Restart. */
/* The goal is to put the C6x into a known good state with */
/* respect to cache, edma and interrupts. */
/* Failure to do this can cause problems when you restart and */
/* run your application code multiple times. This is different */
/* then OnPreFileLoaded() which will do a GEL_Reset() to get the*/
/* C6x into a known good state. */
/*--------------------------------------------------------------*/
OnRestart( int nErrorCode )
{
/*------------------------------------------------------*/
/* Turn off L2 for all EMIFA CE spaces. App should */
/* manage these for coherancy in the application. */
/* GEL_TextOut("Turn off cache segment\n"); */
/*------------------------------------------------------*/
*(int*)0x01848200 = 0; // MAR0
*(int*)0x01848204 = 0; // MAR1
*(int*)0x01848208 = 0; // MAR2
*(int*)0x0184820c = 0; // MAR3
/*------------------------------------------------------*/
/* Disable EDMA events and interrupts and clear any */
/* pending events. */
/* GEL_TextOut("Disable EDMA event\n"); */
/*------------------------------------------------------*/
*(int*)0x01A0FFA8 = 0; // CIERH
*(int*)0x01A0FFB4 = 0; // EERH
*(int*)0x01A0FFB8 = 0XFFFFFFFF; // ECRH
*(int*)0x01A0FFE8 = 0; // CIERL
*(int*)0x01A0FFF4 = 0; // EERL
*(int*)0x01A0FFF8 = 0xFFFFFFFF; // ECRL
/* Disable other interrupts */
IER = 0;
IFR = 0;
}
/*--------------------------------------------------------------*/
/* OnReset() */
/* This function is called by CCS when you do Debug->Resest. */
/* The goal is to put the C6x into a known good state with */
/* respect to cache, edma and interrupts. */
/*--------------------------------------------------------------*/
OnReset( int nErrorCode )
{
init_emif();
}
/*--------------------------------------------------------------*/
/* OnPreFileLoaded() */
/* This function is called automatically when the 'Load Program'*/
/* Menu item is selected. */
/*--------------------------------------------------------------*/
OnPreFileLoaded()
{
/*------------------------------------------------------*/
/* GEL_Reset() is used to deal with the worst case */
/* senario of unknown target state. If for some reason */
/* a reset is not desired upon target connection, */
/* GEL_Reset() may be removed and replaced with */
/* something "less brutal" like a cache initialization */
/* function. */
/*------------------------------------------------------*/
//GEL_Reset();
flush_cache();
IER = 0;
IFR = 0;
init_emif();
}
/*--------------------------------------------------------------*/
/* OnRestart() */
/* This function is called by CCS when you do Debug->Restart. */
/* The goal is to put the C6x into a known good state with */
/* respect to cache, edma and interrupts. */
/* Failure to do this can cause problems when you restart and */
/* run your application code multiple times. This is different */
/* then OnPreFileLoaded() which will do a GEL_Reset() to get the*/
/* C6x into a known good state. */
/*--------------------------------------------------------------*/
OnRestart( int nErrorCode )
{
/*------------------------------------------------------*/
/* Turn off L2 for all EMIFA CE spaces. App should */
/* manage these for coherancy in the application. */
/* GEL_TextOut("Turn off cache segment\n"); */
/*------------------------------------------------------*/
*(int*)0x01848200 = 0; // MAR0
*(int*)0x01848204 = 0; // MAR1
*(int*)0x01848208 = 0; // MAR2
*(int*)0x0184820c = 0; // MAR3
/*------------------------------------------------------*/
/* Disable EDMA events and interrupts and clear any */
/* pending events. */
/* GEL_TextOut("Disable EDMA event\n"); */
/*------------------------------------------------------*/
*(int*)0x01A0FFA8 = 0; // CIERH
*(int*)0x01A0FFB4 = 0; // EERH
*(int*)0x01A0FFB8 = 0XFFFFFFFF; // ECRH
*(int*)0x01A0FFE8 = 0; // CIERL
*(int*)0x01A0FFF4 = 0; // EERL
*(int*)0x01A0FFF8 = 0xFFFFFFFF; // ECRL
/* Disable other interrupts */
IER = 0;
IFR = 0;
}
由此可以更深刻的了解gel文件的作用和两个版本的区别了。
|