Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of MODSERIAL by
Revision 17:6c9b57c14868, committed 2011-03-08
- Comitter:
- AjK
- Date:
- Tue Mar 08 01:42:25 2011 +0000
- Parent:
- 16:8b1dbf4cce4e
- Child:
- 18:21ef26402365
- Commit message:
- 1.17 See ChangeLog.c
Changed in this revision
ChangeLog.c | Show annotated file Show diff for this revision Revisions of this file |
MODSERIAL.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/ChangeLog.c Sat Feb 12 08:59:03 2011 +0000 +++ b/ChangeLog.c Tue Mar 08 01:42:25 2011 +0000 @@ -1,5 +1,8 @@ /* $Id:$ +1.17 08/Mar/2011 + Fixed a memory leak in the DMA code. + 1.16 - 12 Feb 2011 * Missed one, doh!
--- a/MODSERIAL.h Sat Feb 12 08:59:03 2011 +0000 +++ b/MODSERIAL.h Tue Mar 08 01:42:25 2011 +0000 @@ -820,6 +820,8 @@ #ifdef MODDMA_H + MODDMA_Config *config; + /** * Set the "void pointer" moddma_p to be a pointer to a * MODDMA controller class instance. Used to manage the @@ -855,7 +857,7 @@ case 3: conn = MODDMA::UART3_Tx; break; } - MODDMA_Config *config = new MODDMA_Config; + config = new MODDMA_Config; config ->channelNum ( (MODDMA::CHANNELS)(dmaSendChannel & 0x7) ) ->srcMemAddr ( (uint32_t) buffer ) @@ -867,7 +869,7 @@ ; // config end // Setup the configuration. - if (dma->Setup(config) != MODDMA::Ok) { + if (dma->Setup(config) == 0) { return -1; } @@ -920,6 +922,7 @@ if (dma->irqType() == MODDMA::ErrIrq) dma->clearErrIrq(); dmaSendChannel = -1; _isrDmaSendComplete.call(); + delete(config); } #endif // MODDMA_H