Beispiel #1
0
void run(){
#ifdef DEBUG_DWT
  volatile unsigned int *DWT_CYCCNT = (volatile unsigned int *)0xE0001004; //address of the register
  volatile unsigned int *DWT_CONTROL = (volatile unsigned int *)0xE0001000; //address of the register
  volatile unsigned int *SCB_DEMCR = (volatile unsigned int *)0xE000EDFC; //address of the register
  *SCB_DEMCR = *SCB_DEMCR | 0x01000000;
  *DWT_CONTROL = *DWT_CONTROL | 1 ; // enable the counter
#endif
  for(;;){
    if(doProcessAudio){
#ifdef DEBUG_AUDIO
      setPin(GPIOC, GPIO_Pin_5); // PC5 DEBUG
#endif
#ifdef DEBUG_DWT
      *DWT_CYCCNT = 0; // reset the counter
#endif
      buffer.split(source);
      patches.process(buffer);
      buffer.comb(dest);
      if(collision){
	collision = false;
#ifdef DEBUG_AUDIO
	debugToggle();
#endif
      }else{
	doProcessAudio = false;
      }
#ifdef DEBUG_AUDIO
      clearPin(GPIOC, GPIO_Pin_5); // PC5 DEBUG
#endif
#ifdef DEBUG_DWT
      dwt_count = *DWT_CYCCNT;
#endif
    }
  }
}
Beispiel #2
0
void processBlock(){
  buffer.split(getProgramVector()->audio_input, getProgramVector()->audio_blocksize);
  patches.process(buffer);
  buffer.comb(getProgramVector()->audio_output);
}