[an error occurred while processing this directive]
|
//***********************************************************************************
//* 5502 PLC GEL *
//***********************************************************************************/* The Startup() function is executed when the GEL file is loaded. */
StartUp()
{
PLC5502_Init();
PLC5502_EMIF_Init();
GEL_TextOut("PLC5502 StartUp Complete.\n");
}/* OnPreFileLoaded() is executed before a file is loaded. */
OnPreFileLoaded()
{
/* Reset the CPU to clean up state */
GEL_Reset();
}/* OnRestart() is executed before a file is loaded. */
OnRestart()
{
/* Disable interrupts */
// *(int *)0x0003 = *(int *)0x0003 | 0x0800; /* Set INTM */
// *(int *)0x0000 = 0; /* Clear IER0 */
// *(int *)0x0045 = 0; /* Clear IER1 */
}menuitem "PLC5502_Initialize";
hotmenu PLC5502_Init()
{
GEL_Reset();
GEL_TextOut("PLC5502_Init Complete.\n");
}/* Initialize the EMIF control registers to access SRAM */
hotmenu PLC5502_EMIF_Init()
{
/* Global EMIF registers */
GEL_MemoryFill(0x800,2,1,0x00F0); /* EGCR1 */
GEL_MemoryFill(0x801,2,1,0x0008); /* EGCR2 */
/* CE2 Setup */
GEL_MemoryFill(0x808,2,1,0x421A); /* CE2_1 */
GEL_MemoryFill(0x809,2,1,0x20A2); /* CE2_2 */
GEL_MemoryFill(0x828,2,1,0x0); /* CE2_SC1 */
GEL_MemoryFill(0x829,2,1,0x0); /* CE2_SC2 *//* Clear SRAM */
//GEL_MemoryFill(0x400000,1,0x8000,0x0);
//GEL_MemoryFill(0x408000,1,0x8000,0x0);GEL_TextOut("PLC5502 EMIF initialization Complete.\n");
}
E-mail: info@telesys.ru