Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Something
Sunday, December 17th, 2006 at 6:56:04pm UTC 

  1. void fiq_record(void) ICODE_ATTR __attribute__ ((interrupt ("FIQ")));
  2. void fiq_record(void)
  3. {
  4.     short value;
  5.     pcm_more_callback_type2 more_ready;
  6.     int status = 0;
  7.  
  8.     /* Clear interrupt */
  9. #if CONFIG_CPU == PP5020
  10.     IISCONFIG &= ~0x01;
  11. #elif CONFIG_CPU == PP5002
  12.     /* TODO */
  13. #endif
  14.  
  15.     while (p_size > 0) {
  16.         if (FIFO_FULL_COUNT < 2) {
  17.             /* enable interrupt */
  18. #if CONFIG_CPU == PP5020
  19.             IISCONFIG |= 0x01;
  20. #elif CONFIG_CPU == PP5002
  21.             /* TODO */
  22. #endif
  23.             return;
  24.         }
  25.  
  26.         value = (unsigned short)(IISFIFO_RD >> 16);
  27.         if (value > peak_l) peak_l = value;
  28.         else if (-value > peak_l) peak_l = -value;
  29.         *(p++) = value;
  30.  
  31.         value = (unsigned short)(IISFIFO_RD >> 16);
  32.         if (value > peak_r) peak_r = value;
  33.         else if (-value > peak_r) peak_r = -value;
  34.         *(p++) = value;
  35.  
  36.         p_size -= 4;
  37.  
  38.         /* If we have filled the current chunk, start a new one */
  39.         if (p_size == 0) {
  40.             rec_peak_left = peak_l;
  41.             rec_peak_right = peak_r;
  42.             peak_l = peak_r = 0;
  43.         }
  44.     }
  45.    
  46.     more_ready = pcm_callback_more_ready;
  47.  
  48.     if (more_ready != NULL && more_ready(status) >= 0)
  49.     {
  50.         logf("more ready");
  51.         return;
  52.     }
  53.     logf("end");
  54.     /* Finished recording */
  55.     pcm_rec_dma_stop();
  56. }

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

comments powered by Disqus
worth-right
worth-right