Advertisement
Guest User

Untitled

a guest
Mar 16th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.36 KB | None | 0 0
  1.  
  2. FRESULT res1;
  3. UINT cnt1;
  4. uint8_t fsm_read_file(FIL * fil, uint16_t * buffer, uint16_t length) {
  5.     res1 = f_read(fil, buffer, 16, &cnt1);
  6.     for(uint16_t i = 0; i < length; i++) {
  7.         buffer[i] = 0;
  8.     }
  9.     if(res1) {
  10.         LOGE("Read sample file error", res1);
  11.         return RET_ERROR;
  12.     }
  13.     if(cnt1 < 16) {
  14.         return RET_FILE_FINISHED;
  15.     }
  16.     return RET_OK;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement