MCF51QE128RM getchar() doesn't return char

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MCF51QE128RM getchar() doesn't return char

1,213 Views
FredT
Contributor II
Hi, I'm trying to get a char coming from a RS232, and I don't receive anythin. I'm using debug to see what's happening, and I see that the getchar() is using this function:

char TERMIO_GetChar( void )
{
size_t cnt = 1;
char ch;
    __read_console(0, (unsigned char *)&ch, &cnt, 0L);
}

I see the entered character in the ch variable, but the function doesn't return the character.

Is the library wrong or I'm a using the wrong library. I'm having those librairies in my project:
- fp_coldfire_nodiv.a
- C_4i_CF_RegABI_MSL.a
- C_4i_CF_RegABI_Runtime.a

Have a nice day !

Fred Talbot
Labels (1)
0 Kudos
1 Reply

232 Views
CrasyCat
Specialist III
Hello
 
Here I would add a
    return (ch);
at the end of the function TERMIO_GetChar.
 
char TERMIO_GetChar( void )
{
size_t cnt = 1;
char ch;
    __read_console(0, (unsigned char *)&ch, &cnt, 0L);
    return ch;
}
This function is implemented in
  {Install}\ColdFire_Support\msl\MSL_C\MSL_Common\Src\printf_tiny_IO.c
 
Make sure to rebuild C_4i_CF_RegABI_MSL.a after you apply this changes
 
 
CrasyCat
0 Kudos