Пример #1
0
ACORAL_COMM_THREAD test(void *args){
	acoral_u32 top,right,v_black;
	screen_id=acoral_dev_open("screen");
	if(screen_id==ACORAL_DEV_ERR_ID){
		acoral_prints("open screen error\n");
	}
	acoral_dev_config(screen_id,CMD_SCREEN_INFO,&screen_info,0);
	screen_buf=screen_info->screen_buf;

	#define BLANK 12
	top=(screen_info->xres -BLANK*2);
	right	=(screen_info->xres-BLANK*2 );
	v_black	=((screen_info->yres -BLANK*4 ) / 6 );

	fill_rect( BLANK, BLANK, ( screen_info->xres - BLANK ), ( screen_info->yres - BLANK ),0x0000);//fill a Rectangle with some color
	fill_rect( (BLANK*2), (BLANK*2 + v_black*0), (right), (BLANK*2 + v_black*1),0x001f);		//fill a Rectangle with some color
	fill_rect( (BLANK*2), (BLANK*2 + v_black*1), (right), (BLANK*2 + v_black*2),0x07e0);		//fill a Rectangle with some color
	fill_rect( (BLANK*2), (BLANK*2 + v_black*2), (right), (BLANK*2 + v_black*3),0xf800);		//fill a Rectangle with some color
	fill_rect( (BLANK*2), (BLANK*2 + v_black*3), (right), (BLANK*2 + v_black*4),0xffe0);		//fill a Rectangle with some color
	fill_rect( (BLANK*2), (BLANK*2 + v_black*4), (right), (BLANK*2 + v_black*5),0xf81f);		//fill a Rectangle with some color
	fill_rect( (BLANK*2), (BLANK*2 + v_black*5), (right), (BLANK*2 + v_black*6),0x07ff);		//fill a Rectangle with some color

	draw_line( BLANK,BLANK, (screen_info->xres-BLANK), (screen_info->yres-BLANK), 0x0000 ) ;
	draw_line( BLANK,(screen_info->yres-BLANK), (screen_info->xres-BLANK), BLANK, 0x0000 ) ;
	draw_line( (screen_info->xres/2),(BLANK*2 + v_black*0), (screen_info->xres/2), (BLANK*2 + v_black*6), 0x0000 ) ;
}
Пример #2
0
/*
;*****************************************************************************************************
;* 函数名称 : telnet_thread
;* 描    述 : 远程登录线程
;* 输 	 入 : arg: 线程参数
;*        
;* 输 	 出 : 无
;*****************************************************************************************************
;*/
void server_client(void *args){
	acoral_u32 len;
	acoral_char strbuf[20];
	acoral_id telnet_id;
	struct netconn *newconn=(struct netconn *)args;	
	if(newconn != NULL)
	{
		telnet_id=acoral_dev_open("con_telnet");
		if(telnet_id<0){
			acoral_prints("No shell Support,will Exit");
			netconn_delete(newconn);
			return;
		}
		acoral_dev_config(telnet_id,CONSOLE_SET_PRIV_DATA,newconn,0);
		acoral_posix_create(NULL,NULL,acoral_shell_enter,telnet_id);
	}
}
Пример #3
0
/**
 * In this function, the hardware should be initialized.
 * Called from ethernetif_init().
 *
 * @param netif the already initialized lwip network interface structure
 *        for this ethernetif
 */
static void
low_level_init(struct netif *netif)
{
	/* set MAC hardware address length */
	netif->hwaddr_len = ETHARP_HWADDR_LEN;

	/* set MAC hardware address */
	/* MAC地址 */
	netif->hwaddr[0] = 0x00;
	netif->hwaddr[1] = 0x11;
	netif->hwaddr[2] = 0x22;
	netif->hwaddr[3] = 0x33;
	netif->hwaddr[4] = 0x44;     
	netif->hwaddr[5] = 0x55;

	/* maximum transfer unit */
	/* 最大传输单元 */
	netif->mtu = 1500;
  
	/* device capabilities */
	/* don't set NETIF_FLAG_ETHARP if this device is not an ethernet one */
	netif->flags = NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP | NETIF_FLAG_LINK_UP;
 
	/* Do whatever else is needed to initialize interface. */
	/* 初始化enc28j60 */
	
	// pegasus0809
	// hw_init(netif->hwaddr);
		
	net_dev_id = acoral_dev_open("netdev");
	if (net_dev_id == ACORAL_DEV_ERR_ID)
	{
		acoral_printerr("Not Found Net Device\n");
		return;
	}
	acoral_dev_config(net_dev_id, NET_DEV_INIT, netif->hwaddr, 0);
}
Пример #4
0
void exit(acoral_32 argc,acoral_char **argv){
	acoral_dev_config(acoral_cur_thread->console_id,CONSOLE_EXIT,NULL,0);
	acoral_shell_exit((void *)argv[0]);
}