Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: Temorarilry corrupted variable LPC2131 GNU Compiler

2006-02-09 by charlesgrenz

Do you have the variable as "volatile"?

regards,
Charles

-- In lpc2000@yahoogroups.com, "lpc2131makingcl" <mking@...> wrote:
>
> To Whom It May Concern:
> I've been having problems with a variable of type "long long" 
> reading back an incorrect value. I'm using 2 external interrupts to 
> generate binary data (0's and 1's). That data gets saved to a 
> variable which when read back is incorrect unless a while loop with 
> a considerable delay time is inserted before accessing the variable.
> 
> Suggested has been to use an ISR "wrapper" in which you call a 
> function from an ISR. Tried that; did not help. Could the "long 
> long" data type be an issue? Code is as follows; card_data is 
> incorrect when trying to read it at statement store_card_data =...
> By the way, the following is part of main() routine, not called from 
> an ISR.
> 
> void process_Card()
> {
> if(card_bits == 26)
> {
>  store_card_data = ((card_data & 0xFFFFFFC000000000) >> 38);
>  site_code = (char)((store_card_data & 0x0000000001FE0000) >> 17);
>  card_num = (long long)((store_card_data & 0x000000000001FFFE) >> 1);
> }
> 
> else if(card_bits == 37)
> {
>   store_card_data = card_data;
> }
> 
> card_data = 0;
> card_bits = 0;
> }
>

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.