Advertisement
Guest User

Untitled

a guest
Mar 16th, 2017
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.57 KB | None | 0 0
  1. uint8_t dac_loop(void) {
  2.     uint8_t res = RET_OK;
  3.     if((DMA1->HISR & DMA_HISR_HTIF5) && loop_go) {
  4.         res = fsm_read_file(current_file, &dac_buff[0], 256);
  5.         DMA1->HIFCR |= DMA_HIFCR_CHTIF5;
  6.         if(res == RET_FILE_FINISHED) {
  7.             return RET_FILE_FINISHED;
  8.         }
  9.     }
  10.     if((DMA1->HISR & DMA_HISR_TCIF5) && loop_go) {
  11.         res = fsm_read_file(current_file, &dac_buff[256], 256);
  12.         DMA1->HIFCR |= DMA_HIFCR_CTCIF5;
  13.         if(res == RET_FILE_FINISHED) {
  14.             return RET_FILE_FINISHED;
  15.         }
  16.     }
  17.     return RET_OK;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement