Advertisement
Guest User

Untitled

a guest
Jan 30th, 2025
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. /**
  2. * DMA Encoder Logic For 2 Encoders
  3. **/
  4. void dma_handler() {
  5. uint i = 1;
  6. int interrupt_channel = 0;
  7. while ((i & dma_hw->ints0) == 0) {
  8. i = i << 1;
  9. ++interrupt_channel;
  10. }
  11. dma_hw->ints0 = 1u << interrupt_channel;
  12. if (interrupt_channel < 4) {
  13. dma_channel_set_read_addr(interrupt_channel, &pio->rxf[interrupt_channel],
  14. true);
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement