Jump to content
Sign in to follow this  
djsmith1000

Weird Array Stuff

Recommended Posts

Hello,

I have found a weird bug. I was just using this code to test my serial library, and this happens.

When I use this, the mcu starts sporatically messing some of my digital I/O pins.

 

for(i_ser = 0; i_ser < PACKETSIZE; i_ser++)

{

//Test:

Serial_Packet[i_ser]++;

 

send_char(Serial_Packet[i_ser]);

}

 

 

when I use this, it works fine!

 

for(i_ser = 0; i_ser < PACKETSIZE; i_ser++)

{

//Test:

i_data = Serial_Packet[i_ser]++;

 

send_char(i_data);

}

 

 

anybody know why this happens?

Thanks for the help,

Dan

Share this post


Link to post
Share on other sites

Dan,

 

Can you provide a larger code fragment,

better still a small complete program that demonstrates the problem you have.

 

Regards

Dave

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...