Hi T,
You're right (as always I must add).
The thing is that I need to make a presentation in which we'd decide at its end on which way to go.
Since it'd take me some time to learn how to operate the DMA, I'll not be able to test it all this week, however a decision needs to be made.
I'm now trying to see how I can efficiently calculate the Size that needs to be transferred to the large 1MB Buffer, since the last transfer.
I think I got it, and would love your help.
What do you think of the following:
1.
Code:
Size =(Last Address Written To 10KB Buffer - Last Address in 10KB Buffer that was Transferred by DMA to 1MB Buffer)
2. Use
Sign-Bit of
Size Variable in order to
XOR it with
Size Variable, and Add it the
Sign-Bit
#2 would take care of having the case of Size Negative, and will actually do nothing in case it is positive.
What do you think of #2?
You're the master in bits
Can it be done otherwise?
What I actually trying to do is an efficient Absolute Value:
Size = |A-B|, where:
A = Last Address Written To 10KB Buffer
B = Last Address in 10KB Buffer that was Transferred by DMA to 1MB Buffer