This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

re:Re: Serial Port in non-blocking mode


I'm getting 0x0 instead of the caracter ... *z = 0x0 when I put a breakpoint on the "if( *z >= 'A' && *z <= 'z' )" (see lower)

In my main I have :

cyg_io_set_config(ser_handle, 0x1081, &zero, &l32);
while(1)
	{
  		t+=dt;
  		if(t>=900)
  			dt = -step;
  		if(t<=100)
  			dt = step;
  		HAL_WRITE_UINT16 (0xFFFAC008, t); // write DAC
  		readch();
	  	/*if(var1)
	  		printf("var 1 : %d\n", var1);*/
	  	
	}

void readch()
{
	int i;
	
	cyg_io_read( ser_handle, z, &l );
	
	if( *z >= 'A' && *z <= 'z' )
	{
		printf(z);
		line[cnt] = *z;
		cyg_io_write( ser_handle, z, &l );
	
		if(cnt<10)
			cnt++;
		if(*z == '\n')
			exec=1;
		
		if(exec)
		{
			exec = 0;
			exec_cmd(line);
			cnt = 1;
		}
	}
}



I'm getting 0x0 instead of the caracter ... *z = 0x0 when I put a breakpoint on the "if( *z >= 'A' && *z <= 'z' )"

>
>----- Original Message ----- 
>From: "Andrew Lunn" <andrew@lunn.ch>
>To: "Gatien Gillon" <ggillon@ulb.ac.be>
>Cc: <ecos-discuss@sources.redhat.com>
>Sent: Thursday, April 21, 2005 5:39 PM
>Subject: Re: [ECOS] Serial Port in non-blocking mode
>
>
>> On Thu, Apr 21, 2005 at 05:02:09PM +0200, Gatien Gillon wrote:
>>> I'm trying to make my AT91EB55 board communicate with a PC, when using 
>>> the
>>> cyg_io_read function the program waits for an input wich is not what i
>>> want. In non blocking mode I keep on getting 0x0's when reading the port
>>> even if I have sended some characters.
>>
>> Are you getting 0x0 as well as, or instead of?
>>
>>        Andrew
>>
>> -- 
>> Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
>> and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
>> 
>
>
>
>-- 
>Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
>and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
>
>



-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]