Example #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 ) ;
}
Example #2
0
int 
BDKB_Open(void)
{
	
	kb_id = acoral_dev_open("kb");
	if ( kb_id<0 ){
		printf("Open kdc device error!!!\n\n\n");
		return -1;
	}
}
Example #3
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);
	}
}
Example #4
0
static int 
TS_Open(void)
{
	acoral_u32 i,x,y;
	acoral_32 fd;
	ts_id=acoral_dev_open("ts");
	fd=OPEN(fix_file,O_RDONLY);
	if(fd<0){
		while(1){
			for(i=0;i<4;){
				Gal_PutBoxRaw(v_pt[i].x,v_pt[i].y,4,4,0xf800);		
				TS_ReadRaw(&x,&y,&event);
				if(event==ACORAL_TS_DOWN){
					p_pt[i].x=x;	
					p_pt[i].y=y;	
					Gal_PutBoxRaw(v_pt[i].x-4,v_pt[i].y-4,20,20,0x00);		
					i++;
				}
			}
			ts_fix.xfactor=((acoral_fl)v_pt[1].x-v_pt[0].x)/((acoral_fl)p_pt[1].x-p_pt[0].x);
			ts_fix.xoffset=v_pt[0].x+2-ts_fix.xfactor*p_pt[0].x;
			ts_fix.yfactor=((acoral_fl)v_pt[1].y-v_pt[0].y)/((acoral_fl)p_pt[1].y-p_pt[0].y);
			ts_fix.yoffset=v_pt[0].y+2-ts_fix.yfactor*p_pt[0].y;
			v_cpt[0].x=ts_fix.xfactor*p_pt[2].x+ts_fix.xoffset-2;
			v_cpt[0].y=ts_fix.yfactor*p_pt[2].y+ts_fix.yoffset-2;
			v_cpt[1].x=ts_fix.xfactor*p_pt[3].x+ts_fix.xoffset-2;
			v_cpt[1].y=ts_fix.yfactor*p_pt[3].y+ts_fix.yoffset-2;
			x=v_cpt[0].x>v_pt[2].x?v_cpt[0].x-v_pt[2].x:v_pt[2].x-v_cpt[0].x;
			y=v_cpt[0].y>v_pt[2].y?v_cpt[0].y-v_pt[2].y:v_pt[2].y-v_cpt[0].y;
			acoral_print("%d,%d\n",x,y);
			if(x<3&&y<3)
				break;
		}
		fd=OPEN(fix_file,O_RDWR);	
		if(fd<0)
			return;	
		WRITE(fd,&ts_fix,sizeof(struct ts_fix_t));
		FLUSH();
		CLOSE(fd);
	}
	else{
		READ(fd,&ts_fix,sizeof(struct ts_fix_t));
		CLOSE(fd);
	}
}
Example #5
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);
}