"sodo.2007" <> wrote:
> I have adapted the ADC code I found here to just sample one input. My
> program has a loop that checks a battery level twice a second. The program
> seems to run fine but after some length of time operating it crashes and
> returns
> :Assertion 'devmem != -1' failed
> Aborted
I agree with Phil that you must be opening /dev/mem each time through the loop
and aren't closing it before the loop starts again.
What you should do is to create (or add to) the initialization routine of your
program. In the initialization routine you should open /dev/mem, and read the
A/D configuration information (stored in the EEPROM).
Your main loop will no longer have to deal with opening/closing /dev/mem or
constantly getting the A/D configuration from EEPROM. This will save time in
your main loop for other tasks.
When your program is about to shutdown, you should create (or add to) the
shutdown routine to close /dev/mem.
--
Cheers!
Kevin.
http://www.ve3syb.ca/ |"What are we going to do today, Borg?"
Owner of Elecraft K2 #2172 |"Same thing we always do, Pinkutus:
| Try to assimilate the world!"
#include <disclaimer/favourite> | -Pinkutus & the Borg
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|