This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NRF9E5 read string from UART

Hello! I need to read a string from UART, there's code below:

unsigned char GetChar(void)
{
    while(!RI)
        ;
    RI = 0;
    return SBUF;
}

int Readfstr(void)
{
	  char first_s, last_s;
		unsigned short int i=0;
		first_s = GetChar();
			if (first_s=='m') 
				{
					uart_buf[i] = first_s;
						while (last_s!='E')
						{
							i++;
							last_s = GetChar();
							uart_buf[i]=last_s;
						}
						return 1;	
				} else return 0;
}

But it doesn't work

Parents Reply Children
No Data
Related