Jesper Nielsen

Wierd wierd function behavior... - MCS08GT32A

Discussion created by Jesper Nielsen on Dec 11, 2008
Latest reply on Dec 11, 2008 by Jesper Nielsen

I really hope someone can tell me whats is going wrong, im fairly new to c/codewarrior and to the HCS08GT32A microcontroller. The following doesn't make any sense me :smileysad:.


my main looks like this:

void main(void)

  char *test_str = "111222333";

void display_string_still(incomming_str)

  unsigned char disp_buffer[BUFFER_LENGTH][BUFFER_HEIGHT]; //BUFFER_LENGTH = 4  BUFFER_HEIGHT = 10
  unsigned char i;
  unsigned char j;

  for(i = 0; i < BUFFER_LENGTH; i++)
    for(j = 0;j < BUFFER_HEIGHT; j++)
      disp_buffer[i][j] = 0b00000000;


The above code doesn't work... But if I out comment the two for-loops it will run perfectly(display_string_rolling_left(incomming_str) is then working and making the text roll on my LEDS). But why?... First of all the for-loops occurs after the display_string_rolling_left(incomming_str) function call. To my knowledge these things should be executed sequential? And since the disp_buffer is a local variable, it shouldn't influence anything out of this void display_string_still() scope?.. Or am I missing something(which problerly is the case since im new in this microcontroller world :smileywink:) ?



Thanks in advance!



Added p/n to subject.

Message Edited by NLFSJ on 2008-12-17 07:47 AM