地址线使用下拉,app中也使用断言,线程栈默认填充0x23+pro,malloc失败直接进断言
This commit is contained in:
@@ -273,4 +273,6 @@
|
||||
添加重复执行指定任务的任务
|
||||
2023.11.23
|
||||
EJ工厂代码otp0地址校验
|
||||
2023.12.1
|
||||
地址线使用下拉,app中也使用断言,线程栈默认填充0x23+pro,malloc失败直接进断言
|
||||
|
||||
|
@@ -69,7 +69,8 @@ void CtrlGpio_DefInit(void)
|
||||
|
||||
//GPIO 配置
|
||||
GPIO_InitStructure.GPIO_Pin=SEG4_Pin|SEG3_Pin|SEG1_Pin|SEG2_Pin;
|
||||
GPIO_InitStructure.GPIO_Mode=GPIO_Mode_IN_FLOATING;
|
||||
// GPIO_InitStructure.GPIO_Mode=GPIO_Mode_IN_FLOATING;
|
||||
GPIO_InitStructure.GPIO_Mode=GPIO_Mode_IPD;
|
||||
GPIO_InitStructure.GPIO_Speed=GPIO_Speed_50MHz;
|
||||
GPIO_Init(GPIOC,&GPIO_InitStructure);
|
||||
|
||||
|
@@ -6,7 +6,7 @@
|
||||
|
||||
|
||||
|
||||
#define BUILD_DATE "2023-11-22 14:44:51"
|
||||
#define BUILD_DATE "2023-12-01 18:39:30"
|
||||
#define SOFT_VERSION "2.06"
|
||||
|
||||
|
||||
|
@@ -176,16 +176,16 @@ void param_err_handle(const char *param,const char *file,const char *fun,int lin
|
||||
void cpy4byte(uint32_t *dst,uint32_t *src,int num_4byte);
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
//#ifdef DEBUG
|
||||
// 如果s==0,则打印
|
||||
#define param_check(s) \
|
||||
if((s)==0){\
|
||||
param_err_handle(#s,__FILE__,__func__,__LINE__);}
|
||||
#else
|
||||
//#else
|
||||
|
||||
#define param_check(s)
|
||||
//#define param_check(s)
|
||||
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
#ifdef RT_THREAD
|
||||
|
||||
|
@@ -82,7 +82,7 @@
|
||||
|
||||
// <o>The stack size of timer thread <0-8192>
|
||||
// <i>Default: 512
|
||||
#define RT_TIMER_THREAD_STACK_SIZE 1024
|
||||
#define RT_TIMER_THREAD_STACK_SIZE 2048
|
||||
|
||||
// <o>The soft-timer tick per second <0-1000>
|
||||
// <i>Default: 100
|
||||
|
@@ -152,7 +152,7 @@ static rt_err_t _rt_thread_init(struct rt_thread *thread,
|
||||
thread->stack_size = stack_size;
|
||||
|
||||
/* init thread stack */
|
||||
rt_memset(thread->stack_addr, '#', thread->stack_size);
|
||||
rt_memset(thread->stack_addr, '#'+priority, thread->stack_size);
|
||||
#ifdef ARCH_CPU_STACK_GROWS_UPWARD
|
||||
thread->sp = (void *)rt_hw_stack_init(thread->entry, thread->parameter,
|
||||
(void *)((char *)thread->stack_addr),
|
||||
|
@@ -15,6 +15,7 @@ typedef struct
|
||||
uint32_t memtblsize ; // 内存表大小
|
||||
uint32_t memblksize; // 内存分块大小
|
||||
uint32_t memsize ; // 内存总大小
|
||||
uint32_t used;
|
||||
void *mutex;
|
||||
}mallco_dev;
|
||||
|
||||
@@ -71,7 +72,9 @@ int mem_perused(void)
|
||||
if(self->memmap[i])used++;
|
||||
}
|
||||
//return (used*100)/(self->memtblsize);
|
||||
return used;
|
||||
self->used=used*MEM_BLOCK_SIZE;
|
||||
// 改为实际使用的字节数
|
||||
return self->used;
|
||||
}
|
||||
|
||||
|
||||
@@ -153,7 +156,7 @@ void *malloc(uint32_t size)
|
||||
}
|
||||
else{
|
||||
used=mem_perused();
|
||||
param_check(used);
|
||||
param_check(0);
|
||||
}
|
||||
return ret_addr;
|
||||
}
|
||||
|
Reference in New Issue
Block a user