• AVR Freaks

a bad Compiler assignment

Author
AdielT
New Member
  • Total Posts : 3
  • Reward points : 0
  • Joined: 2019/07/17 02:28:07
  • Location: 0
  • Status: offline
2019/08/25 06:22:50 (permalink)
0

a bad Compiler assignment

Hi,
I am useing pic 18f87j90 MPLABX xc8 v2.05.
when i writes :
  i = serial_buffer[next_out];
  next_out = (next_out+1) % BUFFER_SIZE;
  rx_data = i;
I dont get the value on rx_data.
but, when i writes :
  i = serial_buffer[next_out];
  rx_data = i;
  next_out = (next_out+1) % BUFFER_SIZE;
I do get the value on rx_data.
What can be the problem?
Thanks Adiel
 
 
 
 
 
#1

3 Replies Related Threads

    Jim Nickerson
    User 452
    • Total Posts : 6187
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: a bad Compiler assignment 2019/08/25 07:04:39 (permalink)
    +1 (1)
    Looks like it works for me

    Attached Image(s)

    #2
    Jim Nickerson
    User 452
    • Total Posts : 6187
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: a bad Compiler assignment 2019/08/25 07:05:24 (permalink)
    0
    AdielT
    Hi,
    I am useing pic 18f87j90 MPLABX xc8 v2.05.
    when i writes :
      i = serial_buffer[next_out];
    next_out = (next_out+1) % BUFFER_SIZE;
    rx_data = i;
    I dont get the value on rx_data.
    but, when i writes :
      i = serial_buffer[next_out];
    rx_data = i;
    next_out = (next_out+1) % BUFFER_SIZE;
    I do get the value on rx_data.
    What can be the problem?
    Thanks Adiel
     

     
     
     
     


    this was what I tried
     
    #3
    Jim Nickerson
    User 452
    • Total Posts : 6187
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: a bad Compiler assignment 2019/08/25 07:15:57 (permalink)
    +1 (1)
    Maybe the compiler is not "bad" after all.
    #4
    Jump to:
    © 2019 APG vNext Commercial Version 4.5