From: Richard T. S. <rs...@pa...> - 2005-11-20 20:39:27
|
I can't help with many of your issues but a couple of thoughts: 1) Don't try to update a database from inside an interrupt routine. Post the event in a queue and have another piece of code de-queue and update the database. You want to get out of the interrupt routine as quickly as possible. 2) It sounds like your interrupts are bouncing. How are you debouncing your sensors? You might want to organize your interrupt inputs so they latch and have to be reset by the driver. _____ From: gum...@li... [mailto:gum...@li...] On Behalf Of Andy Triboletti Sent: Sunday, November 20, 2005 12:27 PM To: Dave Hylands Cc: gum...@li... Subject: [Gumstix-users] some questions about kernel modules with gumstix Hi Dave and gumstix-users, I think you remember me and my project involving the gumstix and interrupt modules for measuring rpm and heart rate. I have a couple more questions. 1) I know that you're not supposed to do anything really time intensive with an interrupt driver, but things would be a lot easier on us if we could call a system command from c. Is there a way to include stdlib.h in a kernel module so we can use system(). I've attached my make file and my gpio_irq.c file. I tried using -I<location of that file on my computer> in the Makefile, but the build failed. I was thinking of doing system("sqlite capstone.db UPDATE bla into bla") which would store/update the rpm count in a database whenever an event happened. 2) For the interrupts with both the RPM reed switch and the vernier heart rate monitor, both connected to gpio pins sometimes 1 event (1 heart beat or 1 reed switch activation) causes the interrupt driver to call the handler function multiple times, sometimes up to half a second apart. I was wondering if you had any ideas about how to filter these out or avoid this. (because sometimes 2 event COULD legitimiately happen .5 seconds apart, and we can't just ignore them) I can tell because it prints out the seconds and milliseconds of the interrupt, and sometimes when I know the sensor has only been activated once it prints out two or three values. I have programmed it in so that if two consecutive interrupts happen at the exact same second and millisecond, ignore the second one. I know writing a char driver to provide the timestamps to some other app is the ideal solution, but after trying to learn about that for a few hours it seems to be pretty involved. Thanks alot for your help so far, and if you have any ideas for these problems. Andy |