diff options
| author | Paul Sokolovsky | 2015-10-11 12:09:43 +0300 |
|---|---|---|
| committer | Paul Sokolovsky | 2015-10-11 15:18:15 +0300 |
| commit | 1b586f3a734c27c78080fb2173bbde17168cb9e4 (patch) | |
| tree | 7f7745881473f84a8d10b0b43a45a4c009342406 /stmhal | |
| parent | 53ca6ae1f362da99b5913505a53904d22f460c63 (diff) | |
py: Rename MP_BOOL() to mp_obj_new_bool() for consistency in naming.
Diffstat (limited to 'stmhal')
| -rw-r--r-- | stmhal/irq.c | 2 | ||||
| -rw-r--r-- | stmhal/modnwcc3k.c | 2 | ||||
| -rw-r--r-- | stmhal/pin.c | 2 | ||||
| -rw-r--r-- | stmhal/sdcard.c | 4 | ||||
| -rw-r--r-- | stmhal/usb.c | 2 |
5 files changed, 6 insertions, 6 deletions
diff --git a/stmhal/irq.c b/stmhal/irq.c index d0d89b394..7a265a52b 100644 --- a/stmhal/irq.c +++ b/stmhal/irq.c @@ -48,7 +48,7 @@ MP_DEFINE_CONST_FUN_OBJ_0(pyb_wfi_obj, pyb_wfi); /// respectively. This return value can be passed to enable_irq to restore /// the IRQ to its original state. STATIC mp_obj_t pyb_disable_irq(void) { - return MP_BOOL(disable_irq() == IRQ_STATE_ENABLED); + return mp_obj_new_bool(disable_irq() == IRQ_STATE_ENABLED); } MP_DEFINE_CONST_FUN_OBJ_0(pyb_disable_irq_obj, pyb_disable_irq); diff --git a/stmhal/modnwcc3k.c b/stmhal/modnwcc3k.c index 7dd5fb2cd..20e7035e5 100644 --- a/stmhal/modnwcc3k.c +++ b/stmhal/modnwcc3k.c @@ -512,7 +512,7 @@ STATIC mp_obj_t cc3k_disconnect(mp_obj_t self_in) { STATIC MP_DEFINE_CONST_FUN_OBJ_1(cc3k_disconnect_obj, cc3k_disconnect); STATIC mp_obj_t cc3k_isconnected(mp_obj_t self_in) { - return MP_BOOL(wlan_connected && ip_obtained); + return mp_obj_new_bool(wlan_connected && ip_obtained); } STATIC MP_DEFINE_CONST_FUN_OBJ_1(cc3k_isconnected_obj, cc3k_isconnected); diff --git a/stmhal/pin.c b/stmhal/pin.c index 8ba6cce8e..9f40b11d6 100644 --- a/stmhal/pin.c +++ b/stmhal/pin.c @@ -305,7 +305,7 @@ STATIC mp_obj_t pin_debug(mp_uint_t n_args, const mp_obj_t *args) { pin_class_debug = mp_obj_is_true(args[1]); return mp_const_none; } - return MP_BOOL(pin_class_debug); + return mp_obj_new_bool(pin_class_debug); } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(pin_debug_fun_obj, 1, 2, pin_debug); STATIC MP_DEFINE_CONST_CLASSMETHOD_OBJ(pin_debug_obj, (mp_obj_t)&pin_debug_fun_obj); diff --git a/stmhal/sdcard.c b/stmhal/sdcard.c index 2e98f73c1..5d86ba5e6 100644 --- a/stmhal/sdcard.c +++ b/stmhal/sdcard.c @@ -244,7 +244,7 @@ bool sdcard_write_blocks_dma(const uint8_t *src, uint32_t block_num, uint32_t nu // consistent interface and methods to mount/unmount it. STATIC mp_obj_t sd_present(mp_obj_t self) { - return MP_BOOL(sdcard_is_present()); + return mp_obj_new_bool(sdcard_is_present()); } STATIC MP_DEFINE_CONST_FUN_OBJ_1(sd_present_obj, sd_present); @@ -256,7 +256,7 @@ STATIC mp_obj_t sd_power(mp_obj_t self, mp_obj_t state) { sdcard_power_off(); result = true; } - return MP_BOOL(result); + return mp_obj_new_bool(result); } STATIC MP_DEFINE_CONST_FUN_OBJ_2(sd_power_obj, sd_power); diff --git a/stmhal/usb.c b/stmhal/usb.c index cedd3525c..ebd2433d2 100644 --- a/stmhal/usb.c +++ b/stmhal/usb.c @@ -363,7 +363,7 @@ STATIC mp_obj_t pyb_usb_vcp_setinterrupt(mp_obj_t self_in, mp_obj_t int_chr_in) STATIC MP_DEFINE_CONST_FUN_OBJ_2(pyb_usb_vcp_setinterrupt_obj, pyb_usb_vcp_setinterrupt); STATIC mp_obj_t pyb_usb_vcp_isconnected(mp_obj_t self_in) { - return MP_BOOL(USBD_CDC_IsConnected()); + return mp_obj_new_bool(USBD_CDC_IsConnected()); } STATIC MP_DEFINE_CONST_FUN_OBJ_1(pyb_usb_vcp_isconnected_obj, pyb_usb_vcp_isconnected); |
