#include "p_apps.h"
#include "flash.h"

#include <reg52.h>

void RunUpgrade()
{
	// We can only use "data" var in this function, "xdata" will cause failure
	DSHORT i;

	// switch to upgrade 
	EA = 0;		// disable all interrupts

    for (i = 0; i < UPGRADE_CODE_SIZE; i ++)
    {
        XBYTE[SRAM_START+i] = UPGRADE_Code[i];
    }
	SwitchPage(128);
}
