Example #1
0
/*
*------------------------------------------------------------------------------
* void main(void)

* Summary	: Application specifc main routine. Initializes all port and
*			: pheriperal and put the main task into an infinite loop.
*
* Input		: None
*
* Output	: None
*
*------------------------------------------------------------------------------
*/
void main(void)
{
	UINT8 i;

	BOARD_init();
	TIMER0_init(TIMER0_RELOAD,0);

	APP_init();

	EnableInterrupts();

	//DelayMs(3000);
		

   	while(TRUE)
    {


		if( heartBeatCount >= 100 )
		{
			HB_task();
			heartBeatCount = 0;
		}

		if( comUpdateCount >= 2 )
		{
			MB_task();
			//COM_task();
			comUpdateCount = 0;
		}

		//ClrWdt();

		if( appUpdateCount >= 50 )
		{
			APP_task();
			appUpdateCount = 0;
		}
		//ClrWdt();


		ClrWdt();
				
    }
}
Example #2
0
void intro_init( void )
{
	static const float projectionmatrix[16] = {
    1.0f, 0.00f,  0.0f,                    0.0f,
    0.0f, 1.25f,  0.0f,                    0.0f,
    0.0f, 0.00f, -(fzf+fzn)/(fzf-fzn),    -1.0f,
    0.0f, 0.00f, -2.0f*fzf*fzn/(fzf-fzn),  0.0f };

    glDisable(GL_DEPTH_TEST);
	glEnable( GL_BLEND );
	glMatrixMode( GL_PROJECTION );
	glLoadMatrixf( projectionmatrix );
    glMatrixMode( GL_MODELVIEW );
//	back_init();
	ACTOR_init(actor_pool);
	cube_init();
	
	BOARD_init();
	
	t0 =  timeGetTime();

	
}
Example #3
0
/*
*------------------------------------------------------------------------------
* void main(void)

* Summary	: Application specifc main routine. Initializes all port and
*			: pheriperal and put the main task into an infinite loop.
*
* Input		: None
*
* Output	: None
*
*------------------------------------------------------------------------------
*/
void main(void)
{
	UINT8 i;
#ifdef KEYPAD_TEST
	UINT8 scancode, duration;
#endif

	BOARD_init();
	TIMER0_init(TIMER0_RELOAD,0);
		
	LCD_init();


#ifdef TEST_LCD
	for(i = 0 ; i< 26; i++)
	{
		LCD_putChar(i+'A');
		DelayMs(200);
	}
	LCD_clear();
#endif


#ifdef TOWER_LAMP_TEST
	GREEN = 1;
	DelayMs(1000);
	GREEN = 0;

	YELLOW = 1;
	DelayMs(1000);
	YELLOW = 0;

	RED = 1;
	DelayMs(1000);
	RED = 0;


	BUZZER = 1;
	DelayMs(1000);
	BUZZER = 0;

#endif


	KEYPAD_init();
	


	UI_init();			//MUST BE DONE AFTER IAS INIT

	APP_init();


#ifdef __UART_TEST__
	COM_txStr("IDEONICS ANDON TERMINAL ");
#endif	


	EnableInterrupts();

	//DelayMs(3000);
		

   	while(TRUE)
    {


		if( heartBeatCount >= 100 )
		{
			HB_task();
			heartBeatCount = 0;
		}


		if( keypadUpdateCount >= 8 )
		{
			KEYPAD_task();
			LinearKeyPad_scan(  );
			keypadUpdateCount = 0;
		}

		if( comUpdateCount >= 2 )
		{
			MB_task();
			//COM_task();
			comUpdateCount = 0;
		}

		//ClrWdt();

		if( appUpdateCount >= 50 )
		{
			APP_task();
			appUpdateCount = 0;
		}
	//ClrWdt();
	


#ifdef KEYPAD_TEST
		if( KEYPAD_read(&scancode, &duration) == TRUE )
			LCD_putChar(scancode);
#else
	if( uiUpdateCount >=40 )
	{
		
		UI_task();
		uiUpdateCount = 0;
	}
#endif


		ClrWdt();
				
    }
}
Example #4
0
/*
*------------------------------------------------------------------------------
* void main(void)

* Summary	: Application specifc main routine. Initializes all port and
*			: pheriperal and put the main task into an infinite loop.
*
* Input		: None
*
* Output	: None
*
*------------------------------------------------------------------------------
*/
void main(void)
{
	UINT8 i;
	volatile UINT16 StartupDelay = 0 ;

#ifdef KEYPAD_TEST
	UINT8 scancode, duration;
#endif

	BOARD_init();
	TIMER0_init(TIMER0_RELOAD,0);
		
	LCD_init();

	for(i = 0 ; i< strlen(DeviceTag); i++)
	{
		LCD_putChar(DeviceTag[i]);
		//DelayMs(200);
	}
	//LCD_clear();


#ifdef TOWER_LAMP_TEST
	GREEN = 1;
	DelayMs(1000);
	GREEN = 0;

	YELLOW = 1;
	DelayMs(1000);
	YELLOW = 0;

	RED = 1;
	DelayMs(1000);
	RED = 0;


	BUZZER = 1;
	DelayMs(1000);
	BUZZER = 0;

#endif


	
	KEYPAD_init();
	


	UI_init();			//MUST BE DONE AFTER IAS INIT

	APP_init();


#ifdef __UART_TEST__
	COM_txStr(DeviceTag);
#endif	


	EnableInterrupts();

	//DelayMs(3000);
		

   	while(TRUE)
    {


		if( heartBeatCount >= 100 )
		{
			HB_task();
			heartBeatCount = 0;
			if(StartupDelay <= STARTDELAY_TIME)
				StartupDelay++;
		}


		if( keypadUpdateCount >= 8 )
		{
			if(StartupDelay >= STARTDELAY_TIME)
			{
				KEYPAD_task();
				keypadUpdateCount = 0;
			}
		}

		if( comUpdateCount >= 2 )
		{
			COM_task();
			comUpdateCount = 0;
		}

		//ClrWdt();

	if( appUpdateCount >= 100 )
	{
		APP_task();
		appUpdateCount = 0;
	}
	//ClrWdt();
	


#ifdef KEYPAD_TEST
		if( KEYPAD_read(&scancode, &duration) == TRUE )
			LCD_putChar(scancode);
#else
	if( uiUpdateCount >=40)
	{
		
		UI_task();
		uiUpdateCount = 0;
	}
#endif


		ClrWdt();
				
    }
}