mirror of
https://github.com/arduino/Arduino.git
synced 2024-12-01 12:24:14 +01:00
pulseInASM: rework comment style
This commit is contained in:
parent
d4a80be045
commit
689c654e8d
@ -20,32 +20,34 @@
|
||||
Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
# The following routine was generated by avr-gcc 4.8.3 with the following parameters
|
||||
# -gstabs -Wa,-ahlmsd=output.lst -dp -fverbose-asm -O2
|
||||
# on the original C function
|
||||
#
|
||||
# unsigned long pulseInSimpl(volatile uint8_t *port, uint8_t bit, uint8_t stateMask, unsigned long maxloops)
|
||||
# {
|
||||
# unsigned long width = 0;
|
||||
# // wait for any previous pulse to end
|
||||
# while ((*port & bit) == stateMask)
|
||||
# if (--maxloops == 0)
|
||||
# return 0;
|
||||
#
|
||||
# // wait for the pulse to start
|
||||
# while ((*port & bit) != stateMask)
|
||||
# if (--maxloops == 0)
|
||||
# return 0;
|
||||
#
|
||||
# // wait for the pulse to stop
|
||||
# while ((*port & bit) == stateMask) {
|
||||
# if (++width == maxloops)
|
||||
# return 0;
|
||||
# }
|
||||
# return width;
|
||||
# }
|
||||
#
|
||||
# some compiler outputs were removed but the rest of the code is untouched
|
||||
/*
|
||||
* The following routine was generated by avr-gcc 4.8.3 with the following parameters
|
||||
* -gstabs -Wa,-ahlmsd=output.lst -dp -fverbose-asm -O2
|
||||
* on the original C function
|
||||
*
|
||||
* unsigned long pulseInSimpl(volatile uint8_t *port, uint8_t bit, uint8_t stateMask, unsigned long maxloops)
|
||||
* {
|
||||
* unsigned long width = 0;
|
||||
* // wait for any previous pulse to end
|
||||
* while ((*port & bit) == stateMask)
|
||||
* if (--maxloops == 0)
|
||||
* return 0;
|
||||
*
|
||||
* // wait for the pulse to start
|
||||
* while ((*port & bit) != stateMask)
|
||||
* if (--maxloops == 0)
|
||||
* return 0;
|
||||
*
|
||||
* // wait for the pulse to stop
|
||||
* while ((*port & bit) == stateMask) {
|
||||
* if (++width == maxloops)
|
||||
* return 0;
|
||||
* }
|
||||
* return width;
|
||||
* }
|
||||
*
|
||||
* some compiler outputs were removed but the rest of the code is untouched
|
||||
*/
|
||||
|
||||
#include <avr/io.h>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user