zitroneneis

Memory Leak in KSDK DSPI Master Peripheral Driver Workaround

Nov 3rd, 2014
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.55 KB | None | 0 0
  1.  /* Init the interrupt sync object.
  2.   * ==> Memory Leak in FreeRTOS abstraction, new counting Semaphore is created
  3.   * for each function call, old semaphores don't get deleted.
  4.   * Simple Fix: only create Semaphore if it doesn't exist yet */
  5.     if(!dspiState->irqSync) {
  6.         OSA_SemaCreate(&dspiState->irqSync, 0);
  7.     } else {
  8.         /* Make sure that the value of Semaphore is 0 before beginning the transfer */
  9.         osa_status_t status;
  10.         do {
  11.             status = OSA_SemaWait(&dspiState->irqSync, 0);
  12.         } while(status == kStatus_OSA_Success);
  13.     }
Advertisement
Add Comment
Please, Sign In to add comment