Hello! I've been experimenting a bit with writing PRU code with c, and I wrote a program that turns on the USR1 light when a button connected to P8-12 is pressed:
https://github.com/AlekMabry/PRU_tutorials/blob/master/button-pru.c Although I want to start using the PRU code for time-specific functions like reading a signal from the HC-SR04 (which is a pulse the length of the distance the sensor sensed). In order to do that I think that I would have to poll the sensor, and each time I check the sensor's value it would increment a value some specified amount. If I where to write a program that polls in exactly, say 20 cycles, I would know that each +1 added to the variable would represent 100ns. However in the C code, I have no idea what it's actually doing in assembly. Take a function for example, if I make a void function, will the assembler have a command that jumps to that part of the code, and then jumps back (adding two cycles or so), or will it just insert that code into wherever the function is called? Is there any way to force the C program to do something in a specified number of cycles, figure out how many cycles the C code is taking, or just write assembly for time-critical parts directly into the C code itself? Thanks, Alek -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/dd23770c-b0e3-4fcb-aaa4-f732907d1f87%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.