|
20 | 20 | Boston, MA 02111-1307 USA
|
21 | 21 | */
|
22 | 22 |
|
23 |
| -# The following routine was generated by avr-gcc 4.8.3 with the following parameters |
24 |
| -# -gstabs -Wa,-ahlmsd=output.lst -dp -fverbose-asm -O2 |
25 |
| -# on the original C function |
26 |
| -# |
27 |
| -# unsigned long pulseInSimpl(volatile uint8_t *port, uint8_t bit, uint8_t stateMask, unsigned long maxloops) |
28 |
| -# { |
29 |
| -# unsigned long width = 0; |
30 |
| -# // wait for any previous pulse to end |
31 |
| -# while ((*port & bit) == stateMask) |
32 |
| -# if (--maxloops == 0) |
33 |
| -# return 0; |
34 |
| -# |
35 |
| -# // wait for the pulse to start |
36 |
| -# while ((*port & bit) != stateMask) |
37 |
| -# if (--maxloops == 0) |
38 |
| -# return 0; |
39 |
| -# |
40 |
| -# // wait for the pulse to stop |
41 |
| -# while ((*port & bit) == stateMask) { |
42 |
| -# if (++width == maxloops) |
43 |
| -# return 0; |
44 |
| -# } |
45 |
| -# return width; |
46 |
| -# } |
47 |
| -# |
48 |
| -# some compiler outputs were removed but the rest of the code is untouched |
| 23 | +/* |
| 24 | + * The following routine was generated by avr-gcc 4.8.3 with the following parameters |
| 25 | + * -gstabs -Wa,-ahlmsd=output.lst -dp -fverbose-asm -O2 |
| 26 | + * on the original C function |
| 27 | + * |
| 28 | + * unsigned long pulseInSimpl(volatile uint8_t *port, uint8_t bit, uint8_t stateMask, unsigned long maxloops) |
| 29 | + * { |
| 30 | + * unsigned long width = 0; |
| 31 | + * // wait for any previous pulse to end |
| 32 | + * while ((*port & bit) == stateMask) |
| 33 | + * if (--maxloops == 0) |
| 34 | + * return 0; |
| 35 | + * |
| 36 | + * // wait for the pulse to start |
| 37 | + * while ((*port & bit) != stateMask) |
| 38 | + * if (--maxloops == 0) |
| 39 | + * return 0; |
| 40 | + * |
| 41 | + * // wait for the pulse to stop |
| 42 | + * while ((*port & bit) == stateMask) { |
| 43 | + * if (++width == maxloops) |
| 44 | + * return 0; |
| 45 | + * } |
| 46 | + * return width; |
| 47 | + * } |
| 48 | + * |
| 49 | + * some compiler outputs were removed but the rest of the code is untouched |
| 50 | + */ |
49 | 51 |
|
50 | 52 | #include <avr/io.h>
|
51 | 53 |
|
|
0 commit comments