We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
The C code is:
#pragma SRC #include<Reg936.h> #define uchar unsigned char #define uint unsigned int extern uchar AA1; extern uchar a_func(uchar) void main() { unsigned char ab,acd; AA1=0xff; P0M1=0xff; P0M2=0xff; ab=1; acd=128; while(1) { if(ab==128) { P0=~acd; ab=128; acd/=2; a_func(acd); } if(acd==128) { P0=~ab; acd=128; ab*=2; a_func(ab/2); } if((ab==128)&&(acd==1)) { ab=1; acd=128; } } }
when i press the "build target",and disappear the error:
C51 FATAL-ERROR - ACTION: PARSING INVOKE-/#PRAGMA-LINE LINE: #pragma SRC ERROR: RESPECIFIED OR CONFLICTING CONTROL
how to deal with the error?
"I want to know which settings I should do."
You have a 'C' file, and you have a separate Assembler file - therefore you do not need to use the SRC directive at all!
Remove both the 'Generate SRC File' option in uVsion and the #pragma SRC in the source file itself.
"Is there any example?"
See: http://www.keil.com/download/docs/53.asp
Thank you very much! I have learned one of the ways to call .asm file in C,but do nOt know how about it. First,I wrote two .C files,and the one to be subroutine with only stating variables.... .. Thanks for your helps!