unit8_t to static uint8_t

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

unit8_t to static uint8_t

Jump to solution
4,320 Views
moti
Contributor I
Hi,
What is the way to cahnge unit8_t registaer to static uint8_t??
I tried to do it whith alot of syntex problems.
Thank you,
Labels (1)
Tags (1)
0 Kudos
1 Solution
1,306 Views
sjmelnikoff
Contributor III
Is "register" the name of your variable? If so, you need to give it a different name, as "register" is a reserved word in C, and cannot be used as an identifier.
 
Steve.

View solution in original post

0 Kudos
3 Replies
1,306 Views
moti
Contributor I
we want to show time in lcd screen (show a register that defined as unit8_t)
 
The function that show the value that in the register (unit_8 static): (lcd_writestringvalue ("the time is",*register,glcd_decformt_c)
if the *register is static - the function display the content if its unit8_t it dosen't.
How its supposed to be?? what to chang in the fun to be able to display unit8_t register.
thank you?
 
void LCD_WriteString
  (
  uint8_t line,  /* IN: Line in display */
  uint8_t *pstr  /* Pointer to text string */
  )
{
  uint8_t len;
  uint8_t x;
  uint8_t *error = "Wrong line 1 & 2";
  if( line == 2 ) {
    LCDLine(LineTwo);
  }
  else if ( line == 1 ) {
    LCDLine(LineOne);
    }
    else {
   LCD_ClearDisplay();
   LCDLine(LineOne);
      pstr = error;
    }
  len = GetStrlen(pstr);
  for ( x = 0; x < len; x++ ) {
    LCD_WriteChar( pstr[x] );
  }
  /* Clear the rest of the line */
  for ( ; x < gMAX_LCD_CHARS_c; x++ ) {
    LCD_WriteChar( ' ' );
  }
0 Kudos
1,307 Views
sjmelnikoff
Contributor III
Is "register" the name of your variable? If so, you need to give it a different name, as "register" is a reserved word in C, and cannot be used as an identifier.
 
Steve.
0 Kudos
1,306 Views
CompilerGuru
NXP Employee
NXP Employee
Please provide a full example of what you tried to do.
And it would also be good to know why you want to uses statics instead of local variables. I really prefer locals.
Daniel
0 Kudos