View Single Post
Old 07-15-2012, 10:01 PM   #202
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
Hmm. I'm attempting to port:

http://www.arduino.cc/cgi-bin/yabb2/...1286718155/all

to kindle specific code but one of the methods is giving me trouble.

The code calls:

Code:
wi = -pgm_read_word_near(Sinewave + j);
Which is an AVR Program.h call as specified here:

http://www.nongnu.org/avr-libc/user-..._pgmspace.html
and more specifically
http://www.nongnu.org/avr-libc/user-...a66b70ecfb7398

It's pretty basic

"Read a word from the program space with a 16-bit (near) address. "

So that's like read a word from the list in Sinewave? OR is the Sinewave method returning an indirect reference to a memory offset or perhaps absolute location? The iterating memory pattern is to facilitate efficient maths; It's actual function is not key here simply it's contents. Am I referencing the address, an offset, the data itself?

It looks to me like a 256 data points sine mapped out by hand. err pourquoi?
I'll read the code again, and again, but I still don't get i.t

Assuming that is is an address? ( random I know, but let's just assume it is)
What's the equivalent c function? fread, or something similar with a buffer?

I'm struggling to grasp what tools I have on offer in c but I'm slowly catching on via reading and absorbing other code. I'm struggling to translate the machine level calls to program space.

I'm not used to be the lame duck of the bunch but we all start somewhere.

Thanks for any and all thoughts on the matter. the code is brief in the main and well documented. This is the last thing I have an issue with

It would be a big help in the push the get RT FFT graphics on the kindle.
twobob is offline   Reply With Quote