Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
1b586f3a
Commit
1b586f3a
authored
Oct 11, 2015
by
Paul Sokolovsky
Browse files
py: Rename MP_BOOL() to mp_obj_new_bool() for consistency in naming.
parent
53ca6ae1
Changes
26
Hide whitespace changes
Inline
Side-by-side
stmhal/modnwcc3k.c
View file @
1b586f3a
...
...
@@ -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
);
...
...
stmhal/pin.c
View file @
1b586f3a
...
...
@@ -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
);
...
...
stmhal/sdcard.c
View file @
1b586f3a
...
...
@@ -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
);
...
...
stmhal/usb.c
View file @
1b586f3a
...
...
@@ -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
);
...
...
teensy/modpyb.c
View file @
1b586f3a
...
...
@@ -248,7 +248,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_0(pyb_standby_obj, pyb_standby);
/// \function have_cdc()
/// Return True if USB is connected as a serial device, False otherwise.
STATIC
mp_obj_t
pyb_have_cdc
(
void
)
{
return
MP_BOOL
(
usb_vcp_is_connected
());
return
mp_obj_new_bool
(
usb_vcp_is_connected
());
}
STATIC
MP_DEFINE_CONST_FUN_OBJ_0
(
pyb_have_cdc_obj
,
pyb_have_cdc
);
...
...
unix/modjni.c
View file @
1b586f3a
...
...
@@ -265,7 +265,7 @@ STATIC mp_obj_t jobject_unary_op(mp_uint_t op, mp_obj_t self_in) {
case
MP_UNARY_OP_LEN
:
{
jint
len
=
JJ
(
CallIntMethod
,
self
->
obj
,
List_size_mid
);
if
(
op
==
MP_UNARY_OP_BOOL
)
{
return
MP_BOOL
(
len
!=
0
);
return
mp_obj_new_bool
(
len
!=
0
);
}
return
MP_OBJ_NEW_SMALL_INT
(
len
);
}
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment