Various modification to the SDK
This commit is contained in:
parent
7b56d964ab
commit
fffb6bb567
@ -5,7 +5,8 @@ ifndef PDIR # {
|
|||||||
GEN_IMAGES= $(TARGET).elf
|
GEN_IMAGES= $(TARGET).elf
|
||||||
GEN_BINS = $(TARGET).bin
|
GEN_BINS = $(TARGET).bin
|
||||||
SUBDIRS = \
|
SUBDIRS = \
|
||||||
$(TOP_DIR)/app
|
$(TOP_DIR)/app \
|
||||||
|
$(TOP_DIR)/lvgl
|
||||||
endif # } PDIR
|
endif # } PDIR
|
||||||
|
|
||||||
ifndef PDIR # {
|
ifndef PDIR # {
|
||||||
@ -29,7 +30,8 @@ endif
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
COMPONENTS_$(TARGET) = \
|
COMPONENTS_$(TARGET) = \
|
||||||
$(TOP_DIR)/app/libuser$(LIB_EXT)
|
$(TOP_DIR)/app/libuser$(LIB_EXT) \
|
||||||
|
$(TOP_DIR)/lvgl/liblvgl$(LIB_EXT)
|
||||||
|
|
||||||
ifeq ($(USE_LIB), 0)
|
ifeq ($(USE_LIB), 0)
|
||||||
COMPONENTS_$(TARGET) += \
|
COMPONENTS_$(TARGET) += \
|
||||||
|
@ -84,6 +84,7 @@ void * mem_alloc_debug(u32 size);
|
|||||||
void mem_free_debug(void *p);
|
void mem_free_debug(void *p);
|
||||||
void * mem_realloc_debug(void *mem_address, u32 size);
|
void * mem_realloc_debug(void *mem_address, u32 size);
|
||||||
void *mem_calloc_debug(u32 length, u32 size);
|
void *mem_calloc_debug(u32 length, u32 size);
|
||||||
|
u32 tls_mem_get_avail_heapsize(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @defgroup System_APIs System APIs
|
* @defgroup System_APIs System APIs
|
||||||
|
@ -773,7 +773,7 @@ u32 tls_mem_get_avail_heapsize(void)
|
|||||||
// tls_os_release_critical(cpu_sr);
|
// tls_os_release_critical(cpu_sr);
|
||||||
tls_os_sem_release(mem_sem);
|
tls_os_sem_release(mem_sem);
|
||||||
|
|
||||||
return availablemem&0xFFFFF000;
|
return availablemem/*&0xFFFFF000*/;
|
||||||
#else
|
#else
|
||||||
u8 *p = NULL;
|
u8 *p = NULL;
|
||||||
u32 startpos = 0;
|
u32 startpos = 0;
|
||||||
|
@ -216,7 +216,7 @@ int main(void)
|
|||||||
u32 value = 0;
|
u32 value = 0;
|
||||||
|
|
||||||
/*standby reason setting in here,because pmu irq will clear it.*/
|
/*standby reason setting in here,because pmu irq will clear it.*/
|
||||||
if ((tls_reg_read32(HR_PMU_INTERRUPT_SRC)>>7)&0x1)
|
if( (tls_reg_read32(HR_PMU_INTERRUPT_SRC) >> 8) & 0x1)
|
||||||
{
|
{
|
||||||
tls_sys_set_reboot_reason(REBOOT_REASON_STANDBY);
|
tls_sys_set_reboot_reason(REBOOT_REASON_STANDBY);
|
||||||
}
|
}
|
||||||
|
@ -1799,11 +1799,14 @@ UBaseType_t uxTaskGetSystemState( TaskStatus_t * const pxTaskStatusArray,
|
|||||||
* will be written, in ASCII form. This buffer is assumed to be large
|
* will be written, in ASCII form. This buffer is assumed to be large
|
||||||
* enough to contain the generated report. Approximately 40 bytes per
|
* enough to contain the generated report. Approximately 40 bytes per
|
||||||
* task should be sufficient.
|
* task should be sufficient.
|
||||||
|
* @param uxWriteBufferSize The size of the pre-allocated string buffer in bytes, the NULL terminating character is included in the size.
|
||||||
|
*
|
||||||
|
* @return The number of bytes or characters written to the buffer
|
||||||
*
|
*
|
||||||
* \defgroup vTaskList vTaskList
|
* \defgroup vTaskList vTaskList
|
||||||
* \ingroup TaskUtils
|
* \ingroup TaskUtils
|
||||||
*/
|
*/
|
||||||
void vTaskList( char * pcWriteBuffer ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
UBaseType_t vTaskList( char * pcWriteBuffer, UBaseType_t uxWriteBufferSize) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* task. h
|
* task. h
|
||||||
|
@ -4516,11 +4516,25 @@ static void prvResetNextTaskUnblockTime( void )
|
|||||||
|
|
||||||
#if ( ( configUSE_TRACE_FACILITY == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
|
#if ( ( configUSE_TRACE_FACILITY == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
|
||||||
|
|
||||||
void vTaskList( char * pcWriteBuffer )
|
UBaseType_t vTaskList( char * pcWriteBuffer, UBaseType_t uxWriteBufferSize)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
|
* If there is no space allocated for the buffer, we do not print anything.
|
||||||
|
*/
|
||||||
|
if(!uxWriteBufferSize || !pcWriteBuffer)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
TaskStatus_t * pxTaskStatusArray;
|
TaskStatus_t * pxTaskStatusArray;
|
||||||
UBaseType_t uxArraySize, x;
|
UBaseType_t uxArraySize, x;
|
||||||
char cStatus;
|
char cStatus;
|
||||||
|
/* We save here the start address of our buffer, it'll be used to compute the written size at the end. */
|
||||||
|
char *startOfWriteBuffer = pcWriteBuffer;
|
||||||
|
/* We reserve the last byte for the string terminating character : \0*/
|
||||||
|
uxWriteBufferSize--;
|
||||||
|
|
||||||
unsigned short usStackRemaining = 0, usCurStack = 0;
|
unsigned short usStackRemaining = 0, usCurStack = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -4549,8 +4563,20 @@ static void prvResetNextTaskUnblockTime( void )
|
|||||||
|
|
||||||
|
|
||||||
/* Make sure the write buffer does not contain a string. */
|
/* Make sure the write buffer does not contain a string. */
|
||||||
//*pcWriteBuffer = ( char ) 0x00;
|
|
||||||
pcWriteBuffer += strlen(strcpy(pcWriteBuffer,"task\t\ttask num\ttask prio\ttask status\tstack total\tstack remain\tstack least remain\tmin stack space\r\n"));
|
strncpy(pcWriteBuffer,"task\t\ttask num\ttask prio\ttask status\tstack total\tstack remain\tstack least remain\tmin stack space\r\n", uxWriteBufferSize);
|
||||||
|
pcWriteBuffer[uxWriteBufferSize] = '\0';
|
||||||
|
UBaseType_t writtenSize = strlen(pcWriteBuffer);
|
||||||
|
/* We move the string pointer n bytes to be ready to write the next data. */
|
||||||
|
pcWriteBuffer += writtenSize;
|
||||||
|
/* We update the remaining size. */
|
||||||
|
uxWriteBufferSize -= writtenSize;
|
||||||
|
|
||||||
|
/* We check if we still have space for the name of the first task.*/
|
||||||
|
if(uxWriteBufferSize < configMAX_TASK_NAME_LEN)
|
||||||
|
{
|
||||||
|
return writtenSize;
|
||||||
|
}
|
||||||
|
|
||||||
/* Take a snapshot of the number of tasks in case it changes while this
|
/* Take a snapshot of the number of tasks in case it changes while this
|
||||||
* function is executing. */
|
* function is executing. */
|
||||||
@ -4615,12 +4641,18 @@ static void prvResetNextTaskUnblockTime( void )
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* We save the start of the buffer to be able to compute the written task name length. */
|
||||||
|
char *startOfbuffer = pcWriteBuffer;
|
||||||
/* Write the task name to the string, padding with spaces so it
|
/* Write the task name to the string, padding with spaces so it
|
||||||
* can be printed in tabular form more easily. */
|
* can be printed in tabular form more easily. */
|
||||||
pcWriteBuffer = prvWriteNameToBuffer( pcWriteBuffer, pxTaskStatusArray[ x ].pcTaskName );
|
pcWriteBuffer = prvWriteNameToBuffer( pcWriteBuffer, pxTaskStatusArray[ x ].pcTaskName );
|
||||||
|
/* We compute the task name written length. */
|
||||||
|
writtenSize = pcWriteBuffer - startOfbuffer;
|
||||||
|
/* We update our buffer size by removing what we just wrote. */
|
||||||
|
uxWriteBufferSize -= writtenSize;
|
||||||
|
|
||||||
/* Write the rest of the string. */
|
/* Write the rest of the string. */
|
||||||
sprintf( pcWriteBuffer, "\t\t%lu\t\t%u\t\t%c\t\t%u\t\t%u\t\t%u\t\t%u\t\r\n",
|
writtenSize = snprintf(pcWriteBuffer, uxWriteBufferSize, "\t\t%lu\t\t%u\t\t%c\t\t%u\t\t%u\t\t%u\t\t%u\t\r\n",
|
||||||
pxTaskStatusArray[ x ].xTaskNumber,
|
pxTaskStatusArray[ x ].xTaskNumber,
|
||||||
( unsigned int ) (configMAX_PRIORITIES - pxTaskStatusArray[ x ].uxCurrentPriority),
|
( unsigned int ) (configMAX_PRIORITIES - pxTaskStatusArray[ x ].uxCurrentPriority),
|
||||||
cStatus,
|
cStatus,
|
||||||
@ -4629,7 +4661,19 @@ static void prvResetNextTaskUnblockTime( void )
|
|||||||
( unsigned int )usStackRemaining,
|
( unsigned int )usStackRemaining,
|
||||||
pxTaskStatusArray[ x ].usStackHighWaterMark ); /*lint !e586 sprintf() allowed as this is compiled with many compilers and this is a utility function only - not part of the core kernel implementation. */
|
pxTaskStatusArray[ x ].usStackHighWaterMark ); /*lint !e586 sprintf() allowed as this is compiled with many compilers and this is a utility function only - not part of the core kernel implementation. */
|
||||||
|
|
||||||
pcWriteBuffer += strlen( pcWriteBuffer ); /*lint !e9016 Pointer arithmetic ok on char pointers especially as in this case where it best denotes the intent of the code. */
|
/* If what we tried to write is bigger than the space which was left in the buffer, then we set the remaining space to 0. */
|
||||||
|
uxWriteBufferSize -= writtenSize > uxWriteBufferSize ? uxWriteBufferSize : writtenSize;
|
||||||
|
|
||||||
|
/* We check if we have space for the next task name. */
|
||||||
|
if(uxWriteBufferSize >= configMAX_TASK_NAME_LEN)
|
||||||
|
{
|
||||||
|
pcWriteBuffer += writtenSize; /*lint !e9016 Pointer arithmetic ok on char pointers especially as in this case where it best denotes the intent of the code. */
|
||||||
|
}
|
||||||
|
/* This means no space left so we exit the loop. */
|
||||||
|
else
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Free the array again. NOTE! If configSUPPORT_DYNAMIC_ALLOCATION
|
/* Free the array again. NOTE! If configSUPPORT_DYNAMIC_ALLOCATION
|
||||||
@ -4639,7 +4683,14 @@ static void prvResetNextTaskUnblockTime( void )
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
mtCOVERAGE_TEST_MARKER();
|
mtCOVERAGE_TEST_MARKER();
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* We don't forget to add the string NULL terminating character. */
|
||||||
|
*pcWriteBuffer = '\0';
|
||||||
|
|
||||||
|
/* We return the number of bytes written during the whole operation. */
|
||||||
|
return pcWriteBuffer - startOfWriteBuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* ( ( configUSE_TRACE_FACILITY == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) ) */
|
#endif /* ( ( configUSE_TRACE_FACILITY == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) ) */
|
||||||
|
@ -1437,7 +1437,7 @@ void tls_os_disp_task_stat_info(void)
|
|||||||
if(NULL == buf)
|
if(NULL == buf)
|
||||||
return;
|
return;
|
||||||
#if configUSE_TRACE_FACILITY
|
#if configUSE_TRACE_FACILITY
|
||||||
vTaskList((char *)buf);
|
vTaskList((char *)buf, 1024);
|
||||||
#endif
|
#endif
|
||||||
printf("\n%s",buf);
|
printf("\n%s",buf);
|
||||||
tls_mem_free(buf);
|
tls_mem_free(buf);
|
||||||
|
@ -43,6 +43,14 @@ INCLUDES += -I $(TOP_DIR)/src/os/rtos/include
|
|||||||
|
|
||||||
INCLUDES += -I $(TOP_DIR)/src/app/factorycmd
|
INCLUDES += -I $(TOP_DIR)/src/app/factorycmd
|
||||||
INCLUDES += -I $(TOP_DIR)/src/app/bleapp
|
INCLUDES += -I $(TOP_DIR)/src/app/bleapp
|
||||||
|
INCLUDES += -I $(TOP_DIR)/app/app_include
|
||||||
|
INCLUDES += -I $(TOP_DIR)/app
|
||||||
|
|
||||||
|
#lvgl include
|
||||||
|
INCLUDES += -I $(TOP_DIR)/lvgl/lvgl_v8.3
|
||||||
|
INCLUDES += -I $(TOP_DIR)/lvgl/lvgl_port
|
||||||
|
|
||||||
|
|
||||||
#nimble host
|
#nimble host
|
||||||
INCLUDES += -I $(TOP_DIR)/src/bt/blehost/ext/tinycrypt/include
|
INCLUDES += -I $(TOP_DIR)/src/bt/blehost/ext/tinycrypt/include
|
||||||
INCLUDES += -I $(TOP_DIR)/src/bt/blehost/nimble/host/include
|
INCLUDES += -I $(TOP_DIR)/src/bt/blehost/nimble/host/include
|
||||||
|
@ -57,6 +57,7 @@ $$(IMAGEODIR)/$(1).elf: $$(OBJS) $$(DEP_OBJS_$(1)) $$(DEP_LIBS_$(1)) $$(DEPENDS_
|
|||||||
@mkdir -p $$(IMAGEODIR)
|
@mkdir -p $$(IMAGEODIR)
|
||||||
$(LINK) -Wl,--gc-sections -Wl,-zmax-page-size=1024 -Wl,--whole-archive $$(OBJS) $$(DEP_OBJS_$(1)) $$(DEP_LIBS_$(1)) $$(if $$(LINKFLAGS_$(1)),$$(LINKFLAGS_$(1))) -Wl,--no-whole-archive $(LINKFLAGS) $(MAP) -o $$@
|
$(LINK) -Wl,--gc-sections -Wl,-zmax-page-size=1024 -Wl,--whole-archive $$(OBJS) $$(DEP_OBJS_$(1)) $$(DEP_LIBS_$(1)) $$(if $$(LINKFLAGS_$(1)),$$(LINKFLAGS_$(1))) -Wl,--no-whole-archive $(LINKFLAGS) $(MAP) -o $$@
|
||||||
$(SIZE) -A -t $(IMAGEODIR)/$(TARGET).elf
|
$(SIZE) -A -t $(IMAGEODIR)/$(TARGET).elf
|
||||||
|
$(SIZE) -B $(IMAGEODIR)/$(TARGET).elf
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(BINODIR)/%.bin: $(IMAGEODIR)/%.elf
|
$(BINODIR)/%.bin: $(IMAGEODIR)/%.elf
|
||||||
|
Loading…
Reference in New Issue
Block a user