Quantcast
Channel:
Viewing all articles
Browse latest Browse all 59170

Forum Post: Global variable not changing in internal memory

$
0
0
Still working on the same project, but with a new bug. (Custom M16c/26a board) I have two files: rearlite_var.c where I declare all variables, and rearlite_bsp.h where I set these same variables with the prefix extern.   For example, in the rearlite_var.c file is unsigned char New_Status; and in the rearlite_bsp.h file is extern unsigned char New_Status; Looking at the watch, the variable New_Status is located at 42e. When a incoming character on UART0 causes in interrupt, the data from 42c to 431 is overwritten with the data F8 0F 33 07 1C 0A. Breaking at that point and using the watch box, you can change the value of 42e, but it does not change - it stays as 33. New_Status is simply a flag, set in the UART0 ISR to indicate that a new (valid) character has arrived and to let a forever while loop in main to change the status of the lights. But without New_Status changing to what I want it to, well it just does not work. I looked in the memory map, thinking that F8 0F 33 07 may be a saved address from the ISR occurring, but nothing is shown in that area of memory. Any ideas would be appreciated. David

Viewing all articles
Browse latest Browse all 59170

Trending Articles