This commit is contained in:
pvvx 2017-09-25 19:31:57 +03:00
parent 7ce370d5b3
commit b075b615b6
26 changed files with 410 additions and 119 deletions

View file

@ -3,7 +3,12 @@
#include "cmsis_os.h"
#include "diag.h"
#if CONFIG_DEBUG_LOG > 2
#define CMSIS_OS_ERR(fmt, args...) DBG_8195A("\n\r%s: " fmt, __FUNCTION__, ## args)
#else
#define CMSIS_OS_ERR(fmt, args...)
#endif
extern void *_memset( void *s, int c, SIZE_T n );
#define os_memset _memset

View file

@ -804,9 +804,9 @@ osStatus osMailFree (osMailQId queue_id, void *mail);
#endif // Mail Queues available
//#undef malloc
#undef malloc
#define malloc(size) pvPortMalloc(size)
//#undef free
#undef free
#define free(pbuf) vPortFree(pbuf)
extern void *calloc_freertos(size_t nelements, size_t elementSize);

View file

@ -381,7 +381,7 @@ typedef struct HeapRegion
* terminated by a HeapRegions_t structure that has a size of 0. The region
* with the lowest start address must appear first in the array.
*/
static void vPortDefineHeapRegions( const HeapRegion_t * const pxHeapRegions );
void vPortDefineHeapRegions( const HeapRegion_t * const pxHeapRegions );
/*
* Map to the memory management routines required for the port.

View file

@ -725,6 +725,7 @@ __attribute__(( weak )) void vPortSetupTimerInterrupt( void )
/*-----------------------------------------------------------*/
#if configUSE_IDLE_HOOK
extern void WDGRefresh(void);
void vApplicationIdleHook( void )
{
/* Use the idle task to place the CPU into a low power mode. Greater power

View file

@ -477,7 +477,7 @@ static void prvInsertBlockIntoFreeList(BlockLink_t *pxBlockToInsert) {
}
/*-----------------------------------------------------------*/
static void vPortDefineHeapRegions(const HeapRegion_t * const pxHeapRegions) {
void vPortDefineHeapRegions(const HeapRegion_t * const pxHeapRegions) {
BlockLink_t *pxFirstFreeBlockInRegion = NULL, *pxPreviousFreeBlock;
uint8_t *pucAlignedHeap;
size_t xTotalRegionSize, xTotalHeapSize = 0;
@ -500,9 +500,9 @@ static void vPortDefineHeapRegions(const HeapRegion_t * const pxHeapRegions) {
pxHeapRegion = &(pxHeapRegions[xDefinedRegions]);
uint8 chip_id = HalGetChipId();
uint8_t chip_id = HalGetChipId();
while (pxHeapRegion->xSizeInBytes > 0) {
if (pxHeapRegion->pucStartAddress
if ((uint32_t)pxHeapRegion->pucStartAddress
> 0x20000000 && chip_id >= CHIP_ID_8711AN && chip_id <= CHIP_ID_8711AF) {
// pxHeapRegion->pucStartAddress = 0;
// pxHeapRegion->xSizeInBytes = 0;
@ -585,6 +585,8 @@ static void vPortDefineHeapRegions(const HeapRegion_t * const pxHeapRegions) {
}
extern void * rtl_memcpy(void *dst0, const void *src0, size_t len0);
void* pvPortReAlloc(void *pv, size_t xWantedSize) {
BlockLink_t *pxLink;

View file

@ -78,6 +78,7 @@ task.h is included from an application file. */
#include "task.h"
#include "timers.h"
#include "StackMacros.h"
#include "tcm_heap.h"
/* Lint e961 and e750 are suppressed as a MISRA exception justified because the
MPU ports require MPU_WRAPPERS_INCLUDED_FROM_API_FILE to be defined for the
@ -3570,7 +3571,7 @@ char * sprintf_pcTaskName(char * buf, char * name)
cStatus = 0x00;
break;
}
pcWriteBuffer = sprintf_pcTaskName( pcWriteBuffer, pxTaskStatusArray[ x ].pcTaskName);
pcWriteBuffer = sprintf_pcTaskName( pcWriteBuffer, (char *)pxTaskStatusArray[ x ].pcTaskName);
sprintf( pcWriteBuffer, "\t%c\t%u\t%u\t%u\r\n", cStatus, ( unsigned int ) pxTaskStatusArray[ x ].uxCurrentPriority, ( unsigned int ) pxTaskStatusArray[ x ].usStackHighWaterMark, ( unsigned int ) pxTaskStatusArray[ x ].xTaskNumber );
pcWriteBuffer += strlen( pcWriteBuffer );
@ -3657,6 +3658,7 @@ char * sprintf_pcTaskName(char * buf, char * name)
This will always be rounded down to the nearest integer.
ulTotalRunTimeDiv100 has already been divided by 100. */
#if 1
(void)ulDeltaRunTimeCounter;
ulStatsAsPercentage = pxTaskStatusArray[ x ].ulRunTimeCounter / ulTotalTime;
#else
ulStatsAsPercentage = (100*pxTaskStatusArray[ x ].ulDelataRunTimeCounterOfPeroid) / ulDeltaTotalRunTime;
@ -3666,7 +3668,7 @@ char * sprintf_pcTaskName(char * buf, char * name)
else
ulDeltaRunTimeCounter = portCONFIGURE_STATS_PEROID_VALUE*ulStatsAsPercentage/100;
#endif
pcWriteBuffer = sprintf_pcTaskName( pcWriteBuffer, pxTaskStatusArray[ x ].pcTaskName);
pcWriteBuffer = sprintf_pcTaskName( pcWriteBuffer, (char *)pxTaskStatusArray[ x ].pcTaskName);
if( ulStatsAsPercentage > 0UL )
{
#ifdef portLU_PRINTF_SPECIFIER_REQUIRED