I’m working on some code that requires processing data more frequently than every 26.2ms. In driver-controlled mode, this is not a problem, because I can use Process_Data_From_Local_IO(). However, the autonomous function waits for statusflag.NEW_SPI_DATA before every loop. Is there any reason that I can’t put a call to Process_Data_From_Local_IO() outside of that if statement? I can’t imagine why it wouldn’t work, but I want to make sure that it’s not going to do bad things if I do.
Yeah, we did that last year, it worked great. You can also use interrupts, which we used for counting encoder ticks.
Yeah, interrupts are the only way to go for encoders. However, the interrupt handler is a bad place to be doing math for other sensors. Thanks for the info… being able to process data quickly in autonomous will help immensely.
Actually, the call to Process_Data_From_Local_IO() IS outside of the if statement. And there is no waiting going on. The main loop simply checks the statusflag.NEW_SPI_DATA flag to see if new data is available from the master microprocessor. (It only reads memory. I doesn’t make a function call.) If there is data available, it is processed, and then regardless of whether there was NEW_SPI_DATA available, it calls Process_Data_From_Local_IO.
Sorry. I missed that you were talking about autonomous mode. I’ll get back to you on that (if someone else doesn’t beat me to it.)
I tried to fix that, but I seemed to have failed. See this post: http://www.chiefdelphi.com/forums/showthread.php?threadid=32073