初级会员

- 积分
- 53
- 金钱
- 53
- 注册时间
- 2021-5-23
- 在线时间
- 13 小时
|
//高优先级任务的任务函数
void high_task(void *p_arg)
{
u8 Rx_number;
OS_ERR err;
CPU_SR_ALLOC();
CPU_Init();
OS_CRITICAL_ENTER();
drv_spi_init();
NRF24L01_Gpio_Init();
LED0 = !LED0 ;
delay_ms(100);
LED0 = !LED0 ;
delay_ms(100);
LED0 = !LED0 ;
delay_ms(100);
LED0 = !LED0 ;
delay_ms(100);
LED0 = !LED0 ;
delay_ms(100);
LED0 = !LED0 ;
delay_ms(100);
NRF24L01_check();
RF24L01_Init(); // 2.4G无线射频初始化
RF24L01_Set_Mode( MODE_RX ); // 将SI24R1设置为接受模式
OS_CRITICAL_EXIT();
while(1)
{
CPU_SR_ALLOC();
CPU_Init();
OS_CRITICAL_ENTER();
LED0 = !LED0 ;
delay_ms(50);
OS_CRITICAL_EXIT();
Rx_number=NRF24L01_RxPacket(buff);
if(Rx_number>0)
{
OSSemPost(&TEST_SEM,OS_OPT_POST_1,&err);
}
}
}
故障现象就是LED微微亮一下就灭,去除临界保护后就正常了。 本人最近刚学习UCOSIII望赐教
|
|