??? 09/21/06 23:25 Read: times |
#124840 - How have you measured this? Responding to: ???'s previous message |
Hello Mr. Bulls,
I have a timer interrupt routine which sets flag on every second. What I did was start timer, acall the routine, set break at the end of routine and watch the flag. It is not very accurate but at least it gives my an idea how fast the routine will take. At the break point the flag always set which means it takes almost 1 second to complet the routine, which is very slow. In Hex_2_Ascii, you make a copy of the passed variable - this is unecessary as 'c' passed this variable by value - it gave you a copy already. Pointers on the other hand pass by reference - if you modify a variable pointed to by the pointer, the variable itself is modified. Simply: pass by value: I give you a copy of the value. pass by reference: I tell you where to find the value. So for Hex_2_Ascii I would write: void Hex_2_Ascii(unsigned int val,char *buf,char dig_cnt) { } to call this I would write: Hex_2_Ascii(value,Buf_Kb,5); Thank you very much for your valuable information. Best regards, T.L |
Topic | Author | Date |
Data conversion | 01/01/70 00:00 | |
How have you measured this? | 01/01/70 00:00 | |
How have you measured this? | 01/01/70 00:00 | |
Try This![]() | 01/01/70 00:00 |