/* This code is a small example of a second stage loader which can load any application from 
any FLASH (parallel/Serial) offset in runtime */

#define PARALLEL		//Uncomment to load application from parallel FLASH
//#define SERIAL		//Uncomment to load application from serial	  FLASH

int app_offset_parallel = 0x10000;	//Define the parallel FLASH offset from where the application needs top be loaded	
int app_offset_serial=0;//x10000; //Define the  serial    FLASH offset from where the application needs top be loaded

extern load_application_parallel();

extern load_application_serial();

int main()
{
	
	#ifdef PARALLEL
		asm("jump _load_application_parallel;"); // Load an application from parallel FLASH
	#endif
	
	#ifdef SERIAL
		asm("jump _load_application_serial;");	// Load an application from serial FLASH
	
	#endif
	
	
	return 0;
}