Advertisement
dhruvag2000

diffPRU.cpp

Aug 6th, 2021
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.54 KB | None | 0 0
  1. # git diff core/PRU.cpp
  2. diff --git a/core/PRU.cpp b/core/PRU.cpp
  3. index 90675f5a..a273001d 100644
  4. --- a/core/PRU.cpp
  5. +++ b/core/PRU.cpp
  6. @@ -560,6 +560,7 @@ int PRU::initialise(BelaHw newBelaHw, int pru_num, bool uniformSampleRate, int m
  7.  
  8.  void PRU::initialisePruCommon(const McaspRegisters& mcaspRegisters)
  9.  {
  10. +#define FORCE_MCASP_IRQ // force to use McASP->PRU IRQ
  11.         uint32_t board_flags = 0;
  12.         switch(belaHw) {
  13.         case BelaHw_BelaMiniMultiTdm:
  14. @@ -690,6 +691,10 @@ int PRU::start(char * const filename, const McaspRegisters& mcaspRegisters)
  15.                         fprintf(stderr, "Error: unrecognized hardware\n");
  16.                         return 1;
  17.         }
  18. +#ifdef FORCE_MCASP_IRQ
  19. +pruUsesMcaspIrq = true;
  20. +#endif // FORCE_MCASP_IRQ
  21. +
  22.  
  23.          if(gRTAudioVerbose)
  24.                  printf("%ssing McASP->PRU irq\n", pruUsesMcaspIrq ? "U" : "Not u");
  25. @@ -740,10 +745,12 @@ int PRU::start(char * const filename, const McaspRegisters& mcaspRegisters)
  26.          }
  27.          if(pruUsesMcaspIrq)
  28.         {
  29. +#ifndef FORCE_MCASP_IRQ
  30.                  if ((rtdm_fd_mcasp_to_pru = __wrap_open(rtdm_driver, O_RDWR)) < 0) {
  31.                          fprintf(stderr, "Unable to open rtdm driver to register McASP interrupts: (%d) %s.\n", errno, strerror(errno));
  32.                          return 1;
  33.                  }
  34. +#endif
  35.                  // For rtdm_fd_mcasp_to_pru we use an arbitrary mapping to set up
  36.                  // the McASP to PRU interrupt.
  37.                  // We use PRU-INTC channel 0, which will trigger the PRUs R31.t30
  38.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement