-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TI] Update Number of LWIP Buffers, Fix ICD GPIO build error (#33053)
* Update Number of LWIP Buffers, Fix ICD GPIO build error Update memory interface to support realloc, decrease num message buffers Fix ICD LED Build failures * Restyled by whitespace * Restyled by clang-format * Keep old implementation of realloc for CC3220 --------- Co-authored-by: Restyled.io <[email protected]>
- Loading branch information
1 parent
e62bc1c
commit 8e79e24
Showing
13 changed files
with
504 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,5 +18,7 @@ | |
|
||
#include "Globals.h" | ||
|
||
#if (LED_ENABLE == 1) | ||
LED_Handle sAppRedHandle; | ||
LED_Handle sAppGreenHandle; | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
#include "bget.h" | ||
#include <ti/drivers/dpl/HwiP.h> | ||
#include <ti/drivers/dpl/SwiP.h> | ||
|
||
typedef unsigned int dpl_CSState; | ||
|
||
typedef union _dpl_cs_state_union_t | ||
{ | ||
/** critical section variable as declared in the interface */ | ||
dpl_CSState state; | ||
/** @internal field used to access internal data */ | ||
struct _dpl_cs_state_aggr_t | ||
{ | ||
/** field to store Swi_disable() return value */ | ||
uint_least16_t swikey; | ||
/** field to store Hwi_disable() return value */ | ||
uint_least16_t hwikey; | ||
} each; | ||
} dpl_CSStateUnion; | ||
|
||
/* This is enter critical section for DPL supported devices */ | ||
dpl_CSState dpl_enterCSImpl(void) | ||
{ | ||
|
||
dpl_CSStateUnion cu; | ||
cu.each.swikey = (uint_least16_t) SwiP_disable(); | ||
cu.each.hwikey = (uint_least16_t) HwiP_disable(); | ||
return cu.state; | ||
} | ||
|
||
/* This is exit critical section for DPL supported devices */ | ||
void dpl_leaveCSImpl(dpl_CSState key) | ||
{ | ||
dpl_CSStateUnion * cu = (dpl_CSStateUnion *) &key; | ||
HwiP_restore((uint32_t) cu->each.hwikey); | ||
SwiP_restore((uint32_t) cu->each.swikey); | ||
} | ||
|
||
/* Protected allocation */ | ||
void * pvPortMalloc(size_t xWantedSize) | ||
{ | ||
void * retVal = NULL; | ||
|
||
dpl_CSState state; | ||
state = dpl_enterCSImpl(); | ||
|
||
retVal = bget(xWantedSize); | ||
|
||
dpl_leaveCSImpl(state); | ||
return retVal; | ||
} | ||
|
||
/* Protected Deallocation */ | ||
void vPortFree(void * pv) | ||
{ | ||
dpl_CSState state; | ||
state = dpl_enterCSImpl(); | ||
|
||
brel(pv); | ||
|
||
dpl_leaveCSImpl(state); | ||
} | ||
|
||
void * pvPortRealloc(void * pv, size_t size) | ||
{ | ||
void * retVal = NULL; | ||
|
||
dpl_CSState state; | ||
state = dpl_enterCSImpl(); | ||
|
||
retVal = bgetr(pv, size); | ||
|
||
dpl_leaveCSImpl(state); | ||
return retVal; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/* Protected allocation | ||
malloc/ICall_heapMalloc --> ti_heap_wrapper --> bget protected by critical section | ||
*/ | ||
void * pvPortMalloc(size_t xWantedSize); | ||
|
||
/* Protected Deallocation | ||
Free/ICall_heapFree --> ti_heap_wrapper --> brel protected by critical section | ||
*/ | ||
void vPortFree(void * pv); | ||
void * pvPortRealloc(void * pv, size_t size); |
Oops, something went wrong.