help,因为本人接触sTM32也才一个多礼拜,看普通的程序,没什么问题,但是看UCOS移植过来的还是有点压力,然后现在有几个问题求help:
OSMboxPost(queue->Mbox, (void *)queue);
第一个参数我知道他的意思,像queue->Mbox邮箱发送一个信息,但是我不明白第二个参数有什么要求没,发了有啥作用,
BSP_IntVectSet(BSP_INT_ID_TIM6,TIM6_IRQHandler ); // 注册TIM6s中断
其原函数为
void BSP_IntVectSet (CPU_DATA int_id,
CPU_FNCT_VOID isr)
{
#if (CPU_CFG_CRITICAL_METHOD == CPU_CRITICAL_METHOD_STATUS_LOCAL)
CPU_SR cpu_sr;
#endif
if (int_id < BSP_INT_SRC_NBR) {
CPU_CRITICAL_ENTER();
BSP_IntVectTbl[int_id] = isr;
CPU_CRITICAL_EXIT();
}
}
请问UCOSII中需要将中断注册吗
第三个问题:
OS_CPU_SysTickInit() 系统的clk初始化
是不是ucos 里面要对一部分的 寄存器写参数,然后设定ucos的clk
void OS_CPU_SysTickInit(void)
{
INT32U cnts;
cnts = OS_CPU_SysTickClkFreq() / OS_TICKS_PER_SEC;
OS_CPU_CM3_NVIC_ST_RELOAD = (cnts - 1);
OS_CPU_CM3_NVIC_ST_CTRL |= OS_CPU_CM3_NVIC_ST_CTRL_CLK_SRC | OS_CPU_CM3_NVIC_ST_CTRL_ENABLE;
OS_CPU_CM3_NVIC_ST_CTRL |= OS_CPU_CM3_NVIC_ST_CTRL_INTEN;
}
#define OS_CPU_CM3_NVIC_ST_CTRL (*((volatile INT32U *)0xE000E010))
#define OS_CPU_CM3_NVIC_ST_RELOAD (*((volatile INT32U *)0xE000E014))
#define OS_CPU_CM3_NVIC_ST_CURRENT (*((volatile INT32U *)0xE000E018))
#define OS_CPU_CM3_NVIC_ST_CAL (*((volatile INT32U *)0xE000E01C))