diff options
author | Damien George <damien.p.george@gmail.com> | 2015-04-11 21:50:53 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-04-11 21:50:53 +0100 |
commit | 7a6dbaa89b9768d5e4a51ea63d55e18e72614dd7 (patch) | |
tree | f13674da4220059fed77025af4f47e298fb5e5a0 | |
parent | b1bbe966c408901ae64ea8c8b468694c47d05b1a (diff) | |
download | micropython-7a6dbaa89b9768d5e4a51ea63d55e18e72614dd7.tar.gz micropython-7a6dbaa89b9768d5e4a51ea63d55e18e72614dd7.zip |
stmhal: Make LED object print LED(x) for consistency with constructor.
-rw-r--r-- | stmhal/led.c | 4 | ||||
-rw-r--r-- | tests/pyb/led.py.exp | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/stmhal/led.c b/stmhal/led.c index 272b74c2cd..31665ed5a8 100644 --- a/stmhal/led.c +++ b/stmhal/led.c @@ -212,7 +212,7 @@ void led_debug(int n, int delay) { void led_obj_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) { pyb_led_obj_t *self = self_in; - print(env, "<LED %lu>", self->led_id); + print(env, "LED(%lu)", self->led_id); } /// \classmethod \constructor(id) @@ -228,7 +228,7 @@ STATIC mp_obj_t led_obj_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n // check led number if (!(1 <= led_id && led_id <= NUM_LEDS)) { - nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError, "LED %d does not exist", led_id)); + nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError, "LED(%d) does not exist", led_id)); } // return static led object diff --git a/tests/pyb/led.py.exp b/tests/pyb/led.py.exp index b528706694..4e8d856cd9 100644 --- a/tests/pyb/led.py.exp +++ b/tests/pyb/led.py.exp @@ -1,4 +1,4 @@ -<LED 1> -<LED 2> -<LED 3> -<LED 4> +LED(1) +LED(2) +LED(3) +LED(4) |