Question: Here is a while loop. IF I want to know how many times the function key_pressed() is called, what should I add ? 1 2

Here is a while loop. IF I want to know how many times the function "key_pressed()" is called, what should I add ?
1 2 3 4 while (1) { how_many_loops++; if(keypad_flag) { keypad_flag = 0; // reset the flag for next ISR key key_pressed(); if (key > ) { uint8_t column; uint8_t row; if (key != old_key) { old_key key; how_many_ISR = 0; how_many_loops 0; } 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 /* decode column and row noting ce = 1, ..., C2 = 3, RO = 1,..., R3 = 4 */ column key >> 4; row key & Ox0F; /* print column on top and row on bottom */ LCD_Clear(); LCD_GotoXY(0,0); LCD_PrintInteger(column); LCD_GotoXY(0,1); LCD_PrintInteger(row); LCD_GotoXY(3,1); LCD_PrintInteger(count); /* print out other stats */ LCD_GotoXY(8,0); LCD_PrintInteger(how_many_ISR); LCD_GotoXY(8,1); LCD_PrintDouble(how_many_loops, 1); } } return
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
