Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdint.h>
- #include "pru_ctrl.h"
- // define this to PRU0_CTRL or PRU1_CTRL depending on which core is running this code
- #define PRU_CTRL PRU0_CTRL
- int main() {
- // disable and reset cycle counter
- PRU_CTRL.CTR_EN = 0;
- PRU_CTRL.CYCLE = 0;
- // enable cycle counter
- PRU_CTRL.CTR_EN = 1;
- // ... do stuff here ...
- // read cycle counter
- uint32_t count = PRU_CTRL.CYCLE;
- __halt();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement