Example #1
0
void exec_cmd(char *cmd){
	comm_flush();
	if(stricmp(cmd,"b")==0){
		xprintf(INFO "resetting to bootloader" " (%s:%d)\n",_F_,_L_);
		SCB->VTOR = (BOOTLOADER_START & 0x1FFFFF80);
		RTC_WriteGPREG(LPC_RTC, 2, 0xbbbbbbbb);
		WDT_Init (WDT_CLKSRC_PCLK, WDT_MODE_RESET);
		WDT_Start(1);
		NVIC_EnableIRQ(WDT_IRQn);
	}
	else if(stricmp(cmd,"r")==0){
		xprintf(INFO "reseting" " (%s:%d)\n",_F_,_L_);
		WDT_Init(WDT_CLKSRC_PCLK, WDT_MODE_RESET);
		WDT_Start(1);
		NVIC_EnableIRQ(WDT_IRQn);
		while(1);//lockup, wdt will reset board
		//WDT_ClrTimeOutFlag();
	}
	else if(stricmp(cmd,"t")==0){
		xprintf(INFO "tests running" " (%s:%d)\n",_F_,_L_);
	}
	else if(stricmp(cmd,"q")==0){
		xprintf(INFO "q" " (%s:%d)\n",_F_,_L_);
	}
	else if(stricmp(cmd,"")==0){
		xprintf(INFO "\r\nr-Resets board\r\nb-Resets to bootloader\r\nt-led test\r\n" " (%s:%d)\n",_F_,_L_);
	}
	else{
		xprintf(INFO "Command not found (cmd=%s)" " (%s:%d)\n",cmd,_F_,_L_);
	}
	return;
}
Example #2
0
pausescr()
{
comm_flush();
nl();
ansic(1);
put("[ Hit any key ]");
get_c();
put_char(12);
}
Example #3
0
offdos()
{
int i;

for(i=0;i < 21;i++)
	put("\b");
for(i=0;i < 21;i++)
	put(" ");
for(i=0;i < 21;i++)
	put("\b");
comm_flush();
ansic(2);
}
Example #4
0
offwait()
{
int i;

for(i=0;i < 15;i++)
	put("\b");
for(i=0;i < 15;i++)
	put(" ");
for(i=0;i < 15;i++)
	put("\b");
comm_flush();
ansic(2);
}
Example #5
0
chat()
{
int c,kh,ch,x,y;

c=0;
ch=0;
kh=0;
put_char(12);
print("-*[ Force Ten Chat ]*-  %s Chatting with %s #%d",config.sysop,user.name,user.number);
nl();
nl();
nl();
if(!useron)
	{
	nl();
	pl(">>> No user on-line");
	nl();
	}
comm_flush();
while(1)
	{
	if(kbhit())
		{
		kh=1;
		c=getch();
		if(c==0)
			{
			c=getch();
			if(c==68)
				return;
			}
/*		if(c==F1)
			{
			curr_cursor(&x,&y);
			c=kh=0;
			pullmenu();
			cursor(x,y);
			}*/
		if(c==13)
			{
			nl();
			kh=c=0;
			}
		if(c==8)
			{
			bs();
			kh=c=0;
			}
		}
	if(comm_avail())
		{
		ch=1;
		c=comm_getc(1);
		if(c==13)
			{
			nl();
			ch=c=0;
			}
		if(c==8)
			{
			bs();
			ch=c=0;
			}
		}
	if(ch || kh)
		{
		if(kh)
			ansic(1);
		else
			ansic(2);
		ch=kh=0;
		put_char(c);
		}
	}
}