Esempio n. 1
0
/**
* \brief Application entry point for smc_lcd example.
*
* \return Unused (ANSI-C compatibility).
*/
int main(void)
{
  sysclk_init();
  board_init();

  configure_LCD();
  configure_DAC();
  configure_ADC();
  configure_tc(4095);
  configure_Button();
  ili93xx_set_foreground_color(COLOR_BLACK);
  ili93xx_draw_string(60, 110, (uint8_t *) "Amplitude");
  ili93xx_draw_string(10, 10, (uint8_t *) "Amplitude:");
  ili93xx_draw_string(10, 50, (uint8_t *) "Frequencia:");
  atualiza_freq(frequencia);
  atualiza_amp(amplitude);

  ili93xx_draw_pixmap(0,
            ILI93XX_LCD_HEIGHT-100-1,
            240-1,
            100-1,
            &image_data_maua[0]);

  while (1) {
  }
}
Esempio n. 2
0
void atualiza_variavel() {
	ili93xx_set_foreground_color(COLOR_WHITE);
	ili93xx_draw_filled_rectangle(50,100,200,170);
	ili93xx_set_foreground_color(COLOR_BLACK);
	if (isAmp) {
		ili93xx_draw_string(60, 110, (uint8_t *) "Amplitude");
	} else {
		ili93xx_draw_string(60, 110, (uint8_t *) "Frequencia");
	}
}
Esempio n. 3
0
void TC0_Handler(void)
{		static b = 0;
		volatile uint32_t ul_dummy;
		ul_dummy = tc_get_status(TC0,0);
		ili93xx_set_foreground_color(COLOR_BLACK);
		ili93xx_draw_string(10,120, (uint8_t *)"Contador:");
		sprintf(vet, "Timer: %d", b);
		ili93xx_set_foreground_color(COLOR_WHITE);
		ili93xx_draw_filled_rectangle(119, 299, ILI93XX_LCD_WIDTH,319);
		ili93xx_set_foreground_color(COLOR_BLACK);
		ili93xx_draw_string(120, 300, vet);
		b++;
}
Esempio n. 4
0
int main(void)
{
	sysclk_init();
	board_init();

	configure_lcd();
	configure_botao();
	configure_adc();
	configure_tc();
		ili93xx_set_foreground_color(COLOR_BLACK);
	ili93xx_draw_string(10, 20, (uint8_t *)"14 - ADC");
	

	/** Draw text, image and basic shapes on the LCD */
	//ili93xx_set_foreground_color(COLOR_BLACK);
	//ili93xx_draw_string(10, 20, (uint8_t *)"14 - ADC");

	while (1) {
		if(adc_value_new == 1)
		{
		refresh_lcd(adc_value_old);
		adc_value_new = 0;
		}
	}
}
Esempio n. 5
0
/**
* \brief ADC interrupt handler.
*/
void ADC_Handler(void)
{
	uint32_t tmp;
	uint32_t status ;

	status = adc_get_status(ADC);
	
	/* Checa se a interrupção é devido ao canal 5 */
	static float rad_antes = 0;
	if ((status & ADC_ISR_EOC5)) {
		tmp = adc_get_channel_value(ADC, ADC_POT_CHANNEL);

			ili93xx_set_foreground_color(COLOR_WHITE);
			ili93xx_draw_filled_rectangle(9, 39, ILI93XX_LCD_WIDTH,55);
			v=3.3*((float)tmp)/4095.0;
			rad=2*pi*((float)tmp)/4095.0;
			ili93xx_draw_line(120,160,120+54*arm_cos_f32(rad_antes),160+54*arm_sin_f32(rad_antes));
			ili93xx_set_foreground_color(COLOR_BLACK);
			sprintf(vet, "Tensao: %f", v);
			ili93xx_draw_string(10, 40, vet);
			ili93xx_draw_line(120,160,120+54*arm_cos_f32(rad),160+54*arm_sin_f32(rad));
			rad_antes = rad;

	}
	

	
}
Esempio n. 6
0
void refresh_lcd(int text, int init)
{
	ili93xx_set_foreground_color(COLOR_WHITE);
	ili93xx_draw_filled_rectangle(0,init-5,240,init+15);
	ili93xx_set_foreground_color(COLOR_BLACK);
	ili93xx_draw_string(50, init, text);
}
Esempio n. 7
0
void refresh_lcd(int adc_value)
{
	int stringct[20];
	int x2 = 60*cos((adc_value*2*3.1416/4095)+3.1416/2);
	int y2 = 60*sin((adc_value*2*3.1416/4095)+3.1416/2);  
	ili93xx_set_foreground_color(COLOR_WHITE);
	ili93xx_draw_line(x,y,x+x_old,y+y_old);
	ili93xx_draw_filled_rectangle(0,260,240,300);
	ili93xx_set_foreground_color(COLOR_BLACK);
	ili93xx_draw_circle(120,160,50);
	sprintf(stringct,"RV1 = %d Ohms",adc_value*10000/4095);
	ili93xx_draw_string(40, 280, stringct);

	if(adc_value == 4095)
	{
		ili93xx_set_foreground_color(COLOR_RED);
	}
	else
	{
		ili93xx_set_foreground_color(COLOR_BLACK);
	}
	y_old = y2;
	x_old =x2;
		ili93xx_draw_line(x,y,x+x2,y+y2);
		
}
Esempio n. 8
0
static void Button2_Handler(uint32_t id, uint32_t mask)
{	
	sprintf(vet, "Contador: %d", --num);
	ili93xx_set_foreground_color(COLOR_WHITE);
	ili93xx_draw_filled_rectangle(10, 119, ILI93XX_LCD_WIDTH,150);
	ili93xx_set_foreground_color(COLOR_BLACK);
	ili93xx_draw_string(10, 120, vet);
}
Esempio n. 9
0
void atualiza_amp(uint32_t val){
	ili93xx_set_foreground_color(COLOR_WHITE);
	ili93xx_draw_filled_rectangle(125,8,200,40);
	ili93xx_set_foreground_color(COLOR_BLACK);
	char buffer[10];
	snprintf(buffer, 10, "%d", val);
	ili93xx_draw_string(130, 10, (uint8_t *)buffer);
}
Esempio n. 10
0
void init_tela()
{
	ili93xx_set_foreground_color(COLOR_BLACK);
	ili93xx_draw_string(10, 20, (uint8_t *)"Victor");
	ili93xx_draw_string(10, 40, (uint8_t *)"Kaio");
	ili93xx_draw_string(10, 60, (uint8_t *)"Rafael");

	ili93xx_set_foreground_color(COLOR_BLACK);
	ili93xx_draw_filled_rectangle(0,145,240,155);
	ili93xx_draw_filled_rectangle(0,165,240,175);

	ili93xx_set_foreground_color(COLOR_BLACK);
	ili93xx_draw_filled_rectangle(90,260,150,275);
	ili93xx_set_foreground_color(COLOR_RED);
	ili93xx_draw_filled_rectangle(90,275,150,290);
	ili93xx_set_foreground_color(COLOR_YELLOW);
	ili93xx_draw_filled_rectangle(90,290,150,305);	
}
Esempio n. 11
0
/**
 *  Handle Interrupcao botao 2.
 */
static void Button2_Handler(uint32_t id, uint32_t mask)
{
    ili93xx_set_foreground_color(COLOR_WHITE);
	ili93xx_draw_filled_rectangle(125,150,180,190);
	ili93xx_set_foreground_color(COLOR_BLACK);
	sprintf(s_cont1, "Contador %d", cnt);
	ili93xx_draw_string(20,160, s_cont1);
	cnt--;	
}
Esempio n. 12
0
/**
	Desenha um retângulo em cima do valor anterior do contador e sobrescreve o novo valor.
*/
void atualiza_contador(){
	//Limpa a tela com um retângulo branco
	ili93xx_set_foreground_color(COLOR_WHITE);
	ili93xx_draw_filled_rectangle(125,100,200,170);
	
	ili93xx_set_foreground_color(COLOR_BLACK);
	char buffer[10];
	snprintf(buffer, 10, "%d", counter);
	ili93xx_draw_string(130, 110, (uint8_t *)buffer);
}
Esempio n. 13
0
/**
	Desenha um retângulo em cima do valor anterior do contador do tempo e sobrescreve o novo valor.
	Separa o contador em minutos e segundos também.
*/
void atualiza_tempo(){
	//limpa a tela com branco 
	ili93xx_set_foreground_color(COLOR_WHITE);
	ili93xx_draw_filled_rectangle(130,280,ILI93XX_LCD_WIDTH, ILI93XX_LCD_HEIGHT);
	
	
	int seg = tempo % 60;
	int min = tempo / 60;
	
	char buffer[10];
	snprintf(buffer, 10, "%02d:%02d", min, seg);
	ili93xx_set_foreground_color(COLOR_BLACK);
	ili93xx_draw_string(140, 300, (uint8_t *)buffer);
}
Esempio n. 14
0
/**
 *  Interrupt handler for TC0 interrupt. 
 */
void TC0_Handler(void)
{
	volatile uint32_t ul_dummy;

    /****************************************************************
	* Devemos indicar ao TC que a interrupção foi satisfeita.
    ******************************************************************/
	ul_dummy = tc_get_status(TC0,0);

	/* Avoid compiler warning */
	UNUSED(ul_dummy);

	sprintf(s_cont1, "Timer %d", timer);
	ili93xx_set_foreground_color(COLOR_WHITE);
	ili93xx_draw_filled_rectangle(90,190,180,220);
	ili93xx_set_foreground_color(COLOR_BLACK);
	ili93xx_draw_string(20,200, s_cont1);
	timer ++;

}
Esempio n. 15
0
int main(void)
{
	sysclk_init();
	board_init();

	configure_lcd();
	configure_botao();
	configure_adc();
	configure_tc();


	/** Draw text, image and basic shapes on the LCD */
	ili93xx_set_foreground_color(COLOR_BLACK);
	ili93xx_draw_string(10, 20, (uint8_t *)"14 - ADC");
	ili93xx_draw_filled_circle(120,160,60);
	ili93xx_set_foreground_color(COLOR_WHITE);
	ili93xx_draw_filled_circle(120,160,55);

	while (1) {
	}
Esempio n. 16
0
/**
 * \brief Application entry point for smc_lcd example.
 *
 * \return Unused (ANSI-C compatibility).
 */
int main(void)
{
	sysclk_init();
	board_init();

	/** Initialize debug console */
	configure_console();

	/** Enable peripheral clock */
	pmc_enable_periph_clk(ID_SMC);

	/** Configure SMC interface for Lcd */
	smc_set_setup_timing(SMC, ILI93XX_LCD_CS, SMC_SETUP_NWE_SETUP(2)
			| SMC_SETUP_NCS_WR_SETUP(2)
			| SMC_SETUP_NRD_SETUP(2)
			| SMC_SETUP_NCS_RD_SETUP(2));
	smc_set_pulse_timing(SMC, ILI93XX_LCD_CS, SMC_PULSE_NWE_PULSE(4)
			| SMC_PULSE_NCS_WR_PULSE(4)
			| SMC_PULSE_NRD_PULSE(10)
			| SMC_PULSE_NCS_RD_PULSE(10));
	smc_set_cycle_timing(SMC, ILI93XX_LCD_CS, SMC_CYCLE_NWE_CYCLE(10)
			| SMC_CYCLE_NRD_CYCLE(22));
#if ((!defined(SAM4S)) && (!defined(SAM4E)))
	smc_set_mode(SMC, ILI93XX_LCD_CS, SMC_MODE_READ_MODE
			| SMC_MODE_WRITE_MODE
			| SMC_MODE_DBW_8_BIT);
#else
	smc_set_mode(SMC, ILI93XX_LCD_CS, SMC_MODE_READ_MODE
			| SMC_MODE_WRITE_MODE);
#endif
	/** Initialize display parameter */
	g_ili93xx_display_opt.ul_width = ILI93XX_LCD_WIDTH;
	g_ili93xx_display_opt.ul_height = ILI93XX_LCD_HEIGHT;
	g_ili93xx_display_opt.foreground_color = COLOR_BLACK;
	g_ili93xx_display_opt.background_color = COLOR_WHITE;

	/** Switch off backlight */
	aat31xx_disable_backlight();

	/** Initialize LCD */
	ili93xx_init(&g_ili93xx_display_opt);

	/** Set backlight level */
	aat31xx_set_backlight(AAT31XX_AVG_BACKLIGHT_LEVEL);

	ili93xx_set_foreground_color(COLOR_WHITE);
	ili93xx_draw_filled_rectangle(0, 0, ILI93XX_LCD_WIDTH,
			ILI93XX_LCD_HEIGHT);
	/** Turn on LCD */
	ili93xx_display_on();
	ili93xx_set_cursor_position(0, 0);

	/** Draw text, image and basic shapes on the LCD */
	ili93xx_set_foreground_color(COLOR_BLACK);
	ili93xx_draw_string(10, 20, (uint8_t *)"ili93xx_lcd example");

	ili93xx_set_foreground_color(COLOR_RED);
	ili93xx_draw_circle(60, 160, 40);
	ili93xx_set_foreground_color(COLOR_GREEN);
	ili93xx_draw_circle(120, 160, 40);
	ili93xx_set_foreground_color(COLOR_BLUE);
	ili93xx_draw_circle(180, 160, 40);

	ili93xx_set_foreground_color(COLOR_VIOLET);
	ili93xx_draw_line(0, 0, 240, 320);

	while (1) {
	}
}
Esempio n. 17
0
/**
 * \brief Application entry point for smc_lcd example.
 *
 * \return Unused (ANSI-C compatibility).
 */
int main(void)
{
	sysclk_init();
	board_init();
	
	/** Configura os botões, o TC e desabilita o Watchdog Timer. */
	configure_buttons();
	WDT->WDT_MR = WDT_MR_WDDIS;
	configure_tc();

	/** Initialize debug console */
	configure_console();

	/** Enable peripheral clock */
	pmc_enable_periph_clk(ID_SMC);

	/** Configure SMC interface for Lcd */
	smc_set_setup_timing(SMC, ILI93XX_LCD_CS, SMC_SETUP_NWE_SETUP(2)
			| SMC_SETUP_NCS_WR_SETUP(2)
			| SMC_SETUP_NRD_SETUP(2)
			| SMC_SETUP_NCS_RD_SETUP(2));
	smc_set_pulse_timing(SMC, ILI93XX_LCD_CS, SMC_PULSE_NWE_PULSE(4)
			| SMC_PULSE_NCS_WR_PULSE(4)
			| SMC_PULSE_NRD_PULSE(10)
			| SMC_PULSE_NCS_RD_PULSE(10));
	smc_set_cycle_timing(SMC, ILI93XX_LCD_CS, SMC_CYCLE_NWE_CYCLE(10)
			| SMC_CYCLE_NRD_CYCLE(22));
#if ((!defined(SAM4S)) && (!defined(SAM4E)))
	smc_set_mode(SMC, ILI93XX_LCD_CS, SMC_MODE_READ_MODE
			| SMC_MODE_WRITE_MODE
			| SMC_MODE_DBW_8_BIT);
#else
	smc_set_mode(SMC, ILI93XX_LCD_CS, SMC_MODE_READ_MODE
			| SMC_MODE_WRITE_MODE);
#endif
	/** Initialize display parameter */
	g_ili93xx_display_opt.ul_width = ILI93XX_LCD_WIDTH;
	g_ili93xx_display_opt.ul_height = ILI93XX_LCD_HEIGHT;
	g_ili93xx_display_opt.foreground_color = COLOR_BLACK;
	g_ili93xx_display_opt.background_color = COLOR_WHITE;

	/** Switch off backlight */
	aat31xx_disable_backlight();

	/** Initialize LCD */
	ili93xx_init(&g_ili93xx_display_opt);

	/** Set backlight level */
	aat31xx_set_backlight(AAT31XX_AVG_BACKLIGHT_LEVEL);

	ili93xx_set_foreground_color(COLOR_WHITE);
	ili93xx_draw_filled_rectangle(0, 0, ILI93XX_LCD_WIDTH,
			ILI93XX_LCD_HEIGHT);
			
	/** Turn on LCD */
	ili93xx_display_on();
	ili93xx_set_cursor_position(0, 0);

	/** Escreve os nomes no display. */
	ili93xx_set_foreground_color(COLOR_BLACK);
	ili93xx_draw_string(10, 20, (uint8_t *)"Bruna Tavares");
	ili93xx_draw_string(10, 40, (uint8_t *)"Bruno Campos");
	ili93xx_draw_string(10, 60, (uint8_t *)"Keneth Yamada");
	
	/** Desenha linha */
	ili93xx_set_foreground_color(COLOR_BLUEVIOLET);
	ili93xx_draw_line(0, 90, 240, 90);
	
	/** Escreve contador e tempo no display. */
	ili93xx_set_foreground_color(COLOR_BLACK);
	ili93xx_draw_string(10, 110, (uint8_t *)"Contador");
	ili93xx_draw_string(10, 300, (uint8_t *)"Tempo ");

	/** Escreve valores iniciais do contador. */
	ili93xx_draw_string(130, 110, (uint8_t *)"000");
	ili93xx_draw_string(140, 300, (uint8_t *)"00:00");	

	while (1) {
		// Coloca o microcontrolador em modo Sleep aguardando interrupções.
		pmc_sleep(SAM_PM_SMODE_SLEEP_WFI);
	}
}
Esempio n. 18
0
/* Called by FreeRTOS+UDP when the network connects. */
void vApplicationIPNetworkEventHook( eIPCallbackEvent_t eNetworkEvent )
{
static long lTasksAlreadyCreated = pdFALSE;
const unsigned long ulXCoord = 3, ulYCoord = 3, ulIPAddressOffset = 45;
unsigned long ulIPAddress;
char cIPAddress[ 20 ];

	/* Note:  If the application is started without the network cable plugged in
	then ipconfigUDP_TASK_PRIORITY should be set to 0 in FreeRTOSIPConfig.h to
	ensure the IP task is created at the idle priority.  This is because the Atmel
	ASF GMAC driver polls the GMAC looking for a connection, and doing so will
	prevent any lower priority tasks from executing.  In this demo the IP task is
	started at the idle priority, then set to configMAX_PRIORITIES - 2 in the
	network event hook only after a connection has been established (when the event
	passed into the network event hook is eNetworkUp). */
	if( eNetworkEvent == eNetworkUp )
	{
		/* Ensure tasks are only created once. */
		if( lTasksAlreadyCreated == pdFALSE )
		{
			/* Create the task that handles the CLI on a UDP port.  The port
			number is set using the configUDP_CLI_PORT_NUMBER setting in
			FreeRTOSConfig.h. */
			vStartUDPCommandInterpreterTask( mainUDP_CLI_TASK_STACK_SIZE, mainUDP_CLI_PORT_NUMBER, mainUDP_CLI_TASK_PRIORITY );

			#if( mainINCLUDE_ECHO_CLIENT_TASKS == 1 )
			{
				/* Create the UDP echo tasks.  The UDP echo tasks require the IP
				address of the echo server to be defined using the
				configECHO_SERVER_ADDR0 to configECHO_SERVER_ADDR3 constants in
				FreeRTOSConfig.h. */
				vStartEchoClientTasks( mainECHO_CLIENT_STACK_SIZE, tskIDLE_PRIORITY );
			}
			#endif
		}

		/* Obtain the IP address, convert it to a string, then display it on the
		LCD. */
		FreeRTOS_GetAddressConfiguration( &ulIPAddress, NULL, NULL, NULL );
		FreeRTOS_inet_ntoa( ulIPAddress, cIPAddress );
		ili93xx_draw_string( ulXCoord, ulYCoord, ( uint8_t * ) "IP: " );
		ili93xx_draw_string( ulXCoord + ulIPAddressOffset, ulYCoord, ( uint8_t * ) cIPAddress );

		/* Set the priority of the IP task up to the desired priority now it has
		connected. */
		vTaskPrioritySet( NULL, mainCONNECTED_IP_TASK_PRIORITY );
	}

	/* NOTE:  At the time of writing the Ethernet driver does not report the
	cable being unplugged - so the following if() condition will never be met.
	It is included for possible future updates to the driver. */
	if( eNetworkEvent == eNetworkDown )
	{
		/* Ensure the Atmel GMAC drivers don't hog all the CPU time as they look
		for a new connection by lowering the priority of the IP task to that of
		the Idle task. */
		vTaskPrioritySet( NULL, tskIDLE_PRIORITY );

		/* Disconnected - so no IP address. */
		ili93xx_draw_string( ulXCoord, ulYCoord, ( uint8_t * ) "IP:                  " );
	}
}
Esempio n. 19
0
 */
int main(void)
{
	sysclk_init();
	board_init();

	/** Initialize debug console */
	configure_console();
	
	/** Configura o timer */
	configure_tc();
	
	/* Configura os botões */
	configure_buttons();

	/** Enable peripheral clock */
	pmc_enable_periph_clk(ID_SMC);

	/** Configure SMC interface for Lcd */
	smc_set_setup_timing(SMC, ILI93XX_LCD_CS, SMC_SETUP_NWE_SETUP(2)
			| SMC_SETUP_NCS_WR_SETUP(2)
			| SMC_SETUP_NRD_SETUP(2)
			| SMC_SETUP_NCS_RD_SETUP(2));
	smc_set_pulse_timing(SMC, ILI93XX_LCD_CS, SMC_PULSE_NWE_PULSE(4)
			| SMC_PULSE_NCS_WR_PULSE(4)
			| SMC_PULSE_NRD_PULSE(10)
			| SMC_PULSE_NCS_RD_PULSE(10));
	smc_set_cycle_timing(SMC, ILI93XX_LCD_CS, SMC_CYCLE_NWE_CYCLE(10)
			| SMC_CYCLE_NRD_CYCLE(22));
#if ((!defined(SAM4S)) && (!defined(SAM4E)))
	smc_set_mode(SMC, ILI93XX_LCD_CS, SMC_MODE_READ_MODE
			| SMC_MODE_WRITE_MODE
			| SMC_MODE_DBW_8_BIT);
#else
	smc_set_mode(SMC, ILI93XX_LCD_CS, SMC_MODE_READ_MODE
			| SMC_MODE_WRITE_MODE);
#endif
	/** Initialize display parameter */
	g_ili93xx_display_opt.ul_width = ILI93XX_LCD_WIDTH;
	g_ili93xx_display_opt.ul_height = ILI93XX_LCD_HEIGHT;
	g_ili93xx_display_opt.foreground_color = COLOR_BLACK;
	g_ili93xx_display_opt.background_color = COLOR_WHITE;

	/** Switch off backlight */
	aat31xx_disable_backlight();

	/** Initialize LCD */
	ili93xx_init(&g_ili93xx_display_opt);

	/** Set backlight level */
	aat31xx_set_backlight(AAT31XX_AVG_BACKLIGHT_LEVEL);

	ili93xx_set_foreground_color(COLOR_WHITE);
	ili93xx_draw_filled_rectangle(0, 0, ILI93XX_LCD_WIDTH,
			ILI93XX_LCD_HEIGHT);
	/** Turn on LCD */
	ili93xx_display_on();
	ili93xx_set_cursor_position(0, 0);

	/** Draw text, image and basic shapes on the LCD */
	ili93xx_set_foreground_color(COLOR_BLACK);
	ili93xx_draw_string(80, 10, (uint8_t *)"13 - LCD");
	ili93xx_draw_string(10, 40, (uint8_t *)"Andre");
	ili93xx_draw_string(10, 60, (uint8_t *)"Thales");
	ili93xx_draw_string(10, 80, (uint8_t *)"Tete");
	ili93xx_set_foreground_color(COLOR_ORANGE);
	ili93xx_draw_filled_rectangle(0, 100, ILI93XX_LCD_WIDTH,105);
	ili93xx_set_foreground_color(COLOR_GREEN);
	ili93xx_draw_filled_rectangle(0, 106, ILI93XX_LCD_WIDTH,111);
	
	while (1) {
		/* Entra em modo sleep */
		pmc_sleep(SAM_PM_SMODE_SLEEP_WFI);
	}
Esempio n. 20
0
/**
 * \brief GFX task core function.
 *
 * \param pvParameters Junk parameter.
 */
static void gfx_task(void *pvParameters)
{
	uint32_t blink = 0;

	/* Get rid of this compiler warning. */
	pvParameters = pvParameters;

	/* Enable display, backlight and print ATMEL logo. */
	ili93xx_set_cursor_position(0,0);
	ili93xx_set_foreground_color(COLOR_WHITE);
	ili93xx_draw_filled_rectangle(0, 0, ILI93XX_LCD_WIDTH, ILI93XX_LCD_HEIGHT);
	gfx_draw_bmpfile(logo_atmel_bmp);
	ili93xx_display_on();
	for (uint32_t i = AAT31XX_MIN_BACKLIGHT_LEVEL; i <= AAT31XX_MAX_BACKLIGHT_LEVEL; ++i) {
		aat31xx_set_backlight(i);
		vTaskDelay(40);
	}
	vTaskDelay(presentation_delay);

	/* Draw IP config menu. */
	ili93xx_set_foreground_color(COLOR_WHITE);
	ili93xx_draw_filled_rectangle(0, 0, ILI93XX_LCD_WIDTH, ILI93XX_LCD_HEIGHT);

#if (IP_SELECTION == IP_FIXED)
	/* Static IP button selected. */
	/* Button 1. */
	ili93xx_set_foreground_color(COLOR_BLACK);
	ili93xx_draw_rectangle(20,70,220,130);
	ili93xx_set_foreground_color(0xE4E4E4u);
	ili93xx_draw_rectangle(22,72,222,132);
	ili93xx_set_foreground_color(COLOR_LIGHTGREY);
	ili93xx_draw_filled_rectangle(21,71,221,131);
	ili93xx_set_foreground_color(COLOR_BLACK);
	ili93xx_draw_string(92, 91, (uint8_t *)"Static");

	/* Button 2. */
	ili93xx_set_foreground_color(0xE4E4E4u);
	ili93xx_draw_rectangle(20,170,220,230);
	ili93xx_set_foreground_color(COLOR_BLACK);
	ili93xx_draw_rectangle(22,172,222,232);
	ili93xx_set_foreground_color(COLOR_LIGHTGREY);
	ili93xx_draw_filled_rectangle(21,171,221,231);
	ili93xx_set_foreground_color(COLOR_BLACK);
	ili93xx_draw_string(102, 191, (uint8_t *)"DHCP");
#else
	/* DHCP IP button selected. */
	/* Button 1. */
	ili93xx_set_foreground_color(0xE4E4E4u);
	ili93xx_draw_rectangle(20,70,220,130);
	ili93xx_set_foreground_color(COLOR_BLACK);
	ili93xx_draw_rectangle(22,72,222,132);
	ili93xx_set_foreground_color(COLOR_LIGHTGREY);
	ili93xx_draw_filled_rectangle(21,71,221,131);
	ili93xx_set_foreground_color(COLOR_BLACK);
	ili93xx_draw_string(92, 91, (uint8_t *)"Static");

	/* Button 2. */
	ili93xx_set_foreground_color(COLOR_BLACK);
	ili93xx_draw_rectangle(20,170,220,230);
	ili93xx_set_foreground_color(0xE4E4E4u);
	ili93xx_draw_rectangle(22,172,222,232);
	ili93xx_set_foreground_color(COLOR_LIGHTGREY);
	ili93xx_draw_filled_rectangle(21,171,221,231);
	ili93xx_set_foreground_color(COLOR_BLACK);
	ili93xx_draw_string(102, 191, (uint8_t *)"DHCP");
#endif

	ili93xx_draw_string(22, 30, (uint8_t *)"IP Configuration");
	ili93xx_draw_string(20, 260, (uint8_t *)"Assigned IP:");
	ili93xx_draw_rectangle(20,280,220,310);

	/* Bring up the ethernet interface & initializes timer0, channel0 */
	ili93xx_draw_string(30, 290, (uint8_t *)"Please wait...");
	init_ethernet();
	app_hold = 0;

	/* Show configured IP and unlock all other waiting tasks. */
	ili93xx_set_foreground_color(COLOR_WHITE);
	ili93xx_draw_filled_rectangle(20,280,220,310);
	ili93xx_draw_filled_rectangle(0,0,240,60);
	ili93xx_set_foreground_color(COLOR_BLACK);
	ili93xx_draw_rectangle(20,280,220,310);
	ili93xx_draw_string(30, 290, (uint8_t const*)g_c_ipconfig);

	/* GFX task Loop. */
	while (1)
	{
		/* Make HTTP text to blink to show GFX task activity. */
		if (blink == 0)
		{
			ili93xx_draw_string(5, 30, (uint8_t *)"HTTP server running!");
			blink = 1;
		}
		else
		{
			ili93xx_set_foreground_color(COLOR_WHITE);
			ili93xx_draw_filled_rectangle(0,0,240,60);
			ili93xx_set_foreground_color(COLOR_BLACK);
			blink = 0;
		}

		/* Sleep to reach the expected blink rate. */
		/* Leave some CPU time for other tasks. */
		vTaskDelay(gfx_refresh_rate);
	}
}