diff options
author | Damien George <damien.p.george@gmail.com> | 2020-02-27 15:36:53 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2020-02-28 10:33:03 +1100 |
commit | 69661f3343bedf86e514337cff63d96cc42f8859 (patch) | |
tree | af5dfb380ffdb75dda84828f63cf9d840d992f0f /examples/switch.py | |
parent | 3f39d18c2b884d32f0443e2e8114ff9d7a14d718 (diff) |
all: Reformat C and Python source code with tools/codeformat.py.
This is run with uncrustify 0.70.1, and black 19.10b0.
Diffstat (limited to 'examples/switch.py')
-rw-r--r-- | examples/switch.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/examples/switch.py b/examples/switch.py index 0efaf2267..c099a3529 100644 --- a/examples/switch.py +++ b/examples/switch.py @@ -24,6 +24,7 @@ orange_led = pyb.LED(3) blue_led = pyb.LED(4) all_leds = (red_led, green_led, orange_led, blue_led) + def run_loop(leds=all_leds): """ Start the loop. @@ -31,15 +32,16 @@ def run_loop(leds=all_leds): :param `leds`: Which LEDs to light up upon switch press. :type `leds`: sequence of LED objects """ - print('Loop started.\nPress Ctrl+C to break out of the loop.') + print("Loop started.\nPress Ctrl+C to break out of the loop.") while 1: try: if switch(): [led.on() for led in leds] else: [led.off() for led in leds] - except OSError: # VCPInterrupt # Ctrl+C in interpreter mode. + except OSError: # VCPInterrupt # Ctrl+C in interpreter mode. break -if __name__ == '__main__': + +if __name__ == "__main__": run_loop() |