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.
When I compiled my C program in keil cx51 the "for loop" is not working what is the solution?
The solution is to fix the "for loop".
Do you notice something? You seem to have forgotten to post your "for loop", so we can't help you by telling you what you have done wrong. Please also notice the instruction about how to post source code.
Always (!) spend some time making sure that your questions are complete enough that people can have a chance to answer them. One minute saved when writing your question will waste your hours or days while waiting for an answer!
Transmit_uart("Descriptor data\n\r"); datadisp(number_of_ep);
device_max_power=2*payload[0x22];
pyld_index=0x2c; ///////////////////////////////////////////////////////
When the code above added it is not working other wise it is working //////////////////////////////////////////////////// for(count=0;count<number_of_ep;count++) {
epdata[count].ep_number=(UC)(payload[pyld_index+2]&0x0f);
epdata[count].ep_direction=(UC)(payload[pyld_index+2]>>7);
epdata[count].ep_type=(UC)(payload[pyld_index+3]&0x03);
epdata[count].ep_maxp_size=(UC)(payload[pyld_index+5]&0x07); epdata[count].ep_maxp_size=(UC)((epdata[count].ep_maxp_size<<8)+payload[pyld_index+4]);
epdata[count].ep_mult=(UC)((payload[pyld_index+5]>>3)+1);
epdata[count].ep_poll_intrvl=(UC)(payload[pyld_index+6]);
pyld_index=pyld_index+7; }
What part of Please also notice the instruction about how to post source code where you unable to understand?
Did you really look at the insttructions how to post source code?
Do your code look like the following?
for (i = 0; i < 10; i++) { ; }
Notice the difference? Your code should look like that if you where following the instructions for posting source code!
By the way: Have you based your code on an example? Which example?
How is Transmit_uart() defined?
What does datadisp() do?
You haven't told us what your problem is. What is happending, and what did you expect to happen?
How have your tried to resolve your problem?
Is the for loop run, or does number_of_ep have an invalid value?
What (incorrect) symptoms do you get?
The instructions on how to post source code are very clearly displayed immediately above the box where you typed your message.
But, if even that isn't enough for you, here's a picture to make it blindingly obvious: www.danlhenry.com/.../keil_code.png