about _int_disable

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

about _int_disable

1,535件の閲覧回数
bluehacker
Contributor III

I find _int_disable in MQX seems not disable interrupt actually. see the following codes:

 

_int_disable();

for(i=0;i<3;i++){

file = fopen("a:init.txt","a+");

if(file!=NULL)

break;

}

if(i==3){

return -1;

}

fseek(file,0,IO_SEEK_SET);

_bsp_serve_wdog();

i = write(file,(char*)&board_info,sizeof(board_info));

 

...

fclose(file);

_int_enable();

return 0;

 

I find other tasks can get cpu running after _int_disable, and if another task also call above codes, the synchronization trouble occur!

 

 

0 件の賞賛
返信
1 返信

1,088件の閲覧回数
cyborgnegotiato
Senior Contributor II

I don't understand what you really want, function _int_disable() do not mask all interrupts (it is not global interrupt mask like cpsid i) but changing BASEPRI only. This means, you can have high priority interrupts which can't be disabled with _int_disable() but be careful, this high priority interrupt can't call any MQX function.