Skip to content

Commit 6e30f96

Browse files
committed
ports: Convert legacy uppercase macro names to lowercase.
1 parent f036017 commit 6e30f96

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+77
-77
lines changed

Diff for: ports/cc3200/hal/cc3200_hal.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ void mp_hal_stdout_tx_str(const char *str) {
148148

149149
void mp_hal_stdout_tx_strn(const char *str, size_t len) {
150150
if (MP_STATE_PORT(os_term_dup_obj)) {
151-
if (MP_OBJ_IS_TYPE(MP_STATE_PORT(os_term_dup_obj)->stream_o, &pyb_uart_type)) {
151+
if (mp_obj_is_type(MP_STATE_PORT(os_term_dup_obj)->stream_o, &pyb_uart_type)) {
152152
uart_tx_strn(MP_STATE_PORT(os_term_dup_obj)->stream_o, str, len);
153153
} else {
154154
MP_STATE_PORT(os_term_dup_obj)->write[2] = mp_obj_new_str_of_type(&mp_type_str, (const byte *)str, len);
@@ -184,7 +184,7 @@ int mp_hal_stdin_rx_chr(void) {
184184
if (telnet_rx_any()) {
185185
return telnet_rx_char();
186186
} else if (MP_STATE_PORT(os_term_dup_obj)) { // then the stdio_dup
187-
if (MP_OBJ_IS_TYPE(MP_STATE_PORT(os_term_dup_obj)->stream_o, &pyb_uart_type)) {
187+
if (mp_obj_is_type(MP_STATE_PORT(os_term_dup_obj)->stream_o, &pyb_uart_type)) {
188188
if (uart_rx_any(MP_STATE_PORT(os_term_dup_obj)->stream_o)) {
189189
return uart_rx_char(MP_STATE_PORT(os_term_dup_obj)->stream_o);
190190
}

Diff for: ports/cc3200/mods/modmachine.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ STATIC mp_obj_t machine_unique_id(void) {
122122
STATIC MP_DEFINE_CONST_FUN_OBJ_0(machine_unique_id_obj, machine_unique_id);
123123

124124
STATIC mp_obj_t machine_main(mp_obj_t main) {
125-
if (MP_OBJ_IS_STR(main)) {
125+
if (mp_obj_is_str(main)) {
126126
MP_STATE_PORT(machine_config_main) = main;
127127
} else {
128128
mp_raise_ValueError(mpexception_value_invalid_arguments);

Diff for: ports/cc3200/mods/moduos.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ STATIC mp_obj_t os_dupterm(uint n_args, const mp_obj_t *args) {
133133
if (stream_o == mp_const_none) {
134134
MP_STATE_PORT(os_term_dup_obj) = MP_OBJ_NULL;
135135
} else {
136-
if (!MP_OBJ_IS_TYPE(stream_o, &pyb_uart_type)) {
136+
if (!mp_obj_is_type(stream_o, &pyb_uart_type)) {
137137
// must be a stream-like object providing at least read and write methods
138138
mp_load_method(stream_o, MP_QSTR_read, os_term_dup_obj.read);
139139
mp_load_method(stream_o, MP_QSTR_write, os_term_dup_obj.write);

Diff for: ports/cc3200/mods/modwlan.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ STATIC mp_obj_t wlan_ifconfig(size_t n_args, const mp_obj_t *pos_args, mp_map_t
10121012
};
10131013
return mp_obj_new_tuple(4, ifconfig);
10141014
} else { // set the configuration
1015-
if (MP_OBJ_IS_TYPE(args[1].u_obj, &mp_type_tuple)) {
1015+
if (mp_obj_is_type(args[1].u_obj, &mp_type_tuple)) {
10161016
// set a static ip
10171017
mp_obj_t *items;
10181018
mp_obj_get_array_fixed_n(args[1].u_obj, 4, &items);

Diff for: ports/cc3200/mods/pybpin.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ pin_obj_t *pin_find(mp_obj_t user_obj) {
131131
pin_obj_t *pin_obj;
132132

133133
// if a pin was provided, use it
134-
if (MP_OBJ_IS_TYPE(user_obj, &pin_type)) {
134+
if (mp_obj_is_type(user_obj, &pin_type)) {
135135
pin_obj = user_obj;
136136
return pin_obj;
137137
}

Diff for: ports/cc3200/mods/pybrtc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ STATIC mp_obj_t pyb_rtc_alarm(size_t n_args, const mp_obj_t *pos_args, mp_map_t
367367
uint32_t f_seconds;
368368
uint16_t f_mseconds;
369369
bool repeat = args[2].u_bool;
370-
if (MP_OBJ_IS_TYPE(args[1].u_obj, &mp_type_tuple)) { // datetime tuple given
370+
if (mp_obj_is_type(args[1].u_obj, &mp_type_tuple)) { // datetime tuple given
371371
// repeat cannot be used with a datetime tuple
372372
if (repeat) {
373373
mp_raise_ValueError(mpexception_value_invalid_arguments);

Diff for: ports/esp32/modnetwork.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ STATIC mp_obj_t esp_ifconfig(size_t n_args, const mp_obj_t *args) {
461461
return mp_obj_new_tuple(4, tuple);
462462
} else {
463463
// set
464-
if (MP_OBJ_IS_TYPE(args[1], &mp_type_tuple) || MP_OBJ_IS_TYPE(args[1], &mp_type_list)) {
464+
if (mp_obj_is_type(args[1], &mp_type_tuple) || mp_obj_is_type(args[1], &mp_type_list)) {
465465
mp_obj_t *items;
466466
mp_obj_get_array_fixed_n(args[1], 4, &items);
467467
netutils_parse_ipv4_addr(items[0], (void*)&info.ip, NETUTILS_BIG);
@@ -518,7 +518,7 @@ STATIC mp_obj_t esp_config(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs
518518
if (kwargs->used != 0) {
519519

520520
for (size_t i = 0; i < kwargs->alloc; i++) {
521-
if (MP_MAP_SLOT_IS_FILLED(kwargs, i)) {
521+
if (mp_map_slot_is_filled(kwargs, i)) {
522522
int req_if = -1;
523523

524524
#define QS(x) (uintptr_t)MP_OBJ_NEW_QSTR(x)

Diff for: ports/esp32/modsocket.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ static int _socket_getaddrinfo2(const mp_obj_t host, const mp_obj_t portx, struc
157157
};
158158

159159
mp_obj_t port = portx;
160-
if (MP_OBJ_IS_SMALL_INT(port)) {
160+
if (mp_obj_is_small_int(port)) {
161161
// This is perverse, because lwip_getaddrinfo promptly converts it back to an int, but
162162
// that's the API we have to work with ...
163163
port = mp_obj_str_binary_op(MP_BINARY_OP_MODULO, mp_obj_new_str_via_qstr("%s", 2), port);

Diff for: ports/esp8266/modesp.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ STATIC mp_obj_t esp_flash_read(mp_obj_t offset_in, mp_obj_t len_or_buf_in) {
8787

8888
mp_int_t len;
8989
byte *buf;
90-
bool alloc_buf = MP_OBJ_IS_INT(len_or_buf_in);
90+
bool alloc_buf = mp_obj_is_int(len_or_buf_in);
9191

9292
if (alloc_buf) {
9393
len = mp_obj_get_int(len_or_buf_in);

Diff for: ports/esp8266/modnetwork.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ STATIC mp_obj_t esp_config(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs
347347
if (kwargs->used != 0) {
348348

349349
for (mp_uint_t i = 0; i < kwargs->alloc; i++) {
350-
if (MP_MAP_SLOT_IS_FILLED(kwargs, i)) {
350+
if (mp_map_slot_is_filled(kwargs, i)) {
351351
#define QS(x) (uintptr_t)MP_OBJ_NEW_QSTR(x)
352352
switch ((uintptr_t)kwargs->table[i].key) {
353353
case QS(MP_QSTR_mac): {

Diff for: ports/nrf/boards/microbit/modules/microbitdisplay.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ mp_obj_t microbit_display_show_func(mp_uint_t n_args, const mp_obj_t *pos_args,
8888
bool wait = args[3].u_bool;
8989
bool loop = args[4].u_bool;
9090

91-
if (MP_OBJ_IS_STR(image)) {
91+
if (mp_obj_is_str(image)) {
9292
// arg is a string object
9393
mp_uint_t len;
9494
const char *str = mp_obj_str_get_data(image, &len);
@@ -296,7 +296,7 @@ static void draw_object(mp_obj_t obj) {
296296
}
297297
} else if (mp_obj_get_type(obj) == &microbit_image_type) {
298298
microbit_display_show(display, (microbit_image_obj_t *)obj);
299-
} else if (MP_OBJ_IS_STR(obj)) {
299+
} else if (mp_obj_is_str(obj)) {
300300
mp_uint_t len;
301301
const char *str = mp_obj_str_get_data(obj, &len);
302302
if (len == 1) {

Diff for: ports/nrf/boards/microbit/modules/microbitimage.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ STATIC mp_obj_t microbit_image_make_new(const mp_obj_type_t *type_in, mp_uint_t
214214
}
215215

216216
case 1: {
217-
if (MP_OBJ_IS_STR(args[0])) {
217+
if (mp_obj_is_str(args[0])) {
218218
// arg is a string object
219219
mp_uint_t len;
220220
const char *str = mp_obj_str_get_data(args[0], &len);

Diff for: ports/nrf/modules/machine/pin.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ void pin_init0(void) {
126126
const pin_obj_t *pin_find(mp_obj_t user_obj) {
127127
const pin_obj_t *pin_obj;
128128
// If pin is SMALL_INT
129-
if (MP_OBJ_IS_SMALL_INT(user_obj)) {
129+
if (mp_obj_is_small_int(user_obj)) {
130130
uint8_t value = MP_OBJ_SMALL_INT_VALUE(user_obj);
131131
for (uint8_t i = 0; i < machine_pin_num_of_pins; i++) {
132132
if (machine_pin_obj[i].pin == value) {
@@ -136,7 +136,7 @@ const pin_obj_t *pin_find(mp_obj_t user_obj) {
136136
}
137137

138138
// If a pin was provided, then use it
139-
if (MP_OBJ_IS_TYPE(user_obj, &pin_type)) {
139+
if (mp_obj_is_type(user_obj, &pin_type)) {
140140
pin_obj = user_obj;
141141
if (pin_class_debug) {
142142
printf("Pin map passed pin ");
@@ -149,7 +149,7 @@ const pin_obj_t *pin_find(mp_obj_t user_obj) {
149149
if (MP_STATE_PORT(pin_class_mapper) != mp_const_none) {
150150
pin_obj = mp_call_function_1(MP_STATE_PORT(pin_class_mapper), user_obj);
151151
if (pin_obj != mp_const_none) {
152-
if (!MP_OBJ_IS_TYPE(pin_obj, &pin_type)) {
152+
if (!mp_obj_is_type(pin_obj, &pin_type)) {
153153
mp_raise_ValueError("Pin.mapper didn't return a Pin object");
154154
}
155155
if (pin_class_debug) {

Diff for: ports/nrf/modules/machine/pwm.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ void pwm_init0(void) {
9393

9494

9595
STATIC int hard_pwm_find(mp_obj_t id) {
96-
if (MP_OBJ_IS_INT(id)) {
96+
if (mp_obj_is_int(id)) {
9797
// given an integer id
9898
int pwm_id = mp_obj_get_int(id);
9999
if (pwm_id >= 0 && pwm_id < MP_ARRAY_SIZE(machine_hard_pwm_obj)) {

Diff for: ports/nrf/modules/machine/rtcounter.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ STATIC mp_obj_t machine_rtc_make_new(const mp_obj_type_t *type, size_t n_args, s
159159

160160
if (args[ARG_callback].u_obj == mp_const_none) {
161161
config->callback = NULL;
162-
} else if (MP_OBJ_IS_FUN(args[ARG_callback].u_obj)) {
162+
} else if (mp_obj_is_fun(args[ARG_callback].u_obj)) {
163163
config->callback = args[ARG_callback].u_obj;
164164
} else {
165165
mp_raise_ValueError("callback must be a function");

Diff for: ports/nrf/modules/machine/spi.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ void spi_init0(void) {
131131
}
132132

133133
STATIC int spi_find(mp_obj_t id) {
134-
if (MP_OBJ_IS_STR(id)) {
134+
if (mp_obj_is_str(id)) {
135135
// given a string id
136136
const char *port = mp_obj_str_get_str(id);
137137
if (0) {

Diff for: ports/nrf/modules/machine/timer.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ STATIC mp_obj_t machine_timer_make_new(const mp_obj_type_t *type, size_t n_args,
126126

127127
machine_timer_obj_t *self = (machine_timer_obj_t*)&machine_timer_obj[timer_id];
128128

129-
if (MP_OBJ_IS_FUN(args[ARG_callback].u_obj)) {
129+
if (mp_obj_is_fun(args[ARG_callback].u_obj)) {
130130
machine_timer_callbacks[timer_id] = args[ARG_callback].u_obj;
131131
} else if (args[ARG_callback].u_obj == mp_const_none) {
132132
machine_timer_callbacks[timer_id] = NULL;

Diff for: ports/nrf/modules/music/modmusic.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ STATIC mp_obj_t microbit_music_play(mp_uint_t n_args, const mp_obj_t *pos_args,
320320
// get either a single note or a list of notes
321321
mp_uint_t len;
322322
mp_obj_t *items;
323-
if (MP_OBJ_IS_STR_OR_BYTES(args[0].u_obj)) {
323+
if (mp_obj_is_str_or_bytes(args[0].u_obj)) {
324324
len = 1;
325325
items = &args[0].u_obj;
326326
} else {

Diff for: ports/nrf/modules/ubluepy/ubluepy_characteristic.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ STATIC mp_obj_t ubluepy_characteristic_make_new(const mp_obj_type_t *type, size_
5959
return MP_OBJ_FROM_PTR(s);
6060
}
6161

62-
if (MP_OBJ_IS_TYPE(uuid_obj, &ubluepy_uuid_type)) {
62+
if (mp_obj_is_type(uuid_obj, &ubluepy_uuid_type)) {
6363
s->p_uuid = MP_OBJ_TO_PTR(uuid_obj);
6464
// (void)sd_characterstic_add(s);
6565
} else {

Diff for: ports/nrf/modules/ubluepy/ubluepy_peripheral.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ STATIC mp_obj_t peripheral_advertise(mp_uint_t n_args, const mp_obj_t *pos_args,
193193
ubluepy_advertise_data_t adv_data;
194194
memset(&adv_data, 0, sizeof(ubluepy_advertise_data_t));
195195

196-
if (device_name_obj != mp_const_none && MP_OBJ_IS_STR(device_name_obj)) {
196+
if (device_name_obj != mp_const_none && mp_obj_is_str(device_name_obj)) {
197197
GET_STR_DATA_LEN(device_name_obj, str_data, str_len);
198198

199199
adv_data.p_device_name = (uint8_t *)str_data;
@@ -361,7 +361,7 @@ STATIC mp_obj_t peripheral_connect(mp_uint_t n_args, const mp_obj_t *pos_args, m
361361

362362
ble_drv_gap_event_handler_set(MP_OBJ_FROM_PTR(self), gap_event_handler);
363363

364-
if (MP_OBJ_IS_STR(dev_addr)) {
364+
if (mp_obj_is_str(dev_addr)) {
365365
GET_STR_DATA_LEN(dev_addr, str_data, str_len);
366366
if (str_len == 17) { // Example "11:22:33:aa:bb:cc"
367367

Diff for: ports/nrf/modules/ubluepy/ubluepy_service.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ STATIC mp_obj_t ubluepy_service_make_new(const mp_obj_type_t *type, size_t n_arg
6161
return MP_OBJ_FROM_PTR(s);
6262
}
6363

64-
if (MP_OBJ_IS_TYPE(uuid_obj, &ubluepy_uuid_type)) {
64+
if (mp_obj_is_type(uuid_obj, &ubluepy_uuid_type)) {
6565
s->p_uuid = MP_OBJ_TO_PTR(uuid_obj);
6666

6767
uint8_t type = args[ARG_NEW_TYPE].u_int;
@@ -124,7 +124,7 @@ STATIC mp_obj_t service_get_characteristic(mp_obj_t self_in, mp_obj_t uuid) {
124124
ubluepy_uuid_obj_t * p_uuid = MP_OBJ_TO_PTR(uuid);
125125

126126
// validate that there is an UUID object passed in as parameter
127-
if (!(MP_OBJ_IS_TYPE(uuid, &ubluepy_uuid_type))) {
127+
if (!(mp_obj_is_type(uuid, &ubluepy_uuid_type))) {
128128
mp_raise_ValueError("Invalid UUID parameter");
129129
}
130130

Diff for: ports/nrf/modules/ubluepy/ubluepy_uuid.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ STATIC mp_obj_t ubluepy_uuid_make_new(const mp_obj_type_t *type, size_t n_args,
6666
return MP_OBJ_FROM_PTR(s);
6767
}
6868

69-
if (MP_OBJ_IS_INT(uuid_obj)) {
69+
if (mp_obj_is_int(uuid_obj)) {
7070
s->type = UBLUEPY_UUID_16_BIT;
7171
s->value[1] = (((uint16_t)mp_obj_get_int(uuid_obj)) >> 8) & 0xFF;
7272
s->value[0] = ((uint8_t)mp_obj_get_int(uuid_obj)) & 0xFF;
73-
} else if (MP_OBJ_IS_STR(uuid_obj)) {
73+
} else if (mp_obj_is_str(uuid_obj)) {
7474
GET_STR_DATA_LEN(uuid_obj, str_data, str_len);
7575
if (str_len == 6) { // Assume hex digit prefixed with 0x
7676
s->type = UBLUEPY_UUID_16_BIT;
@@ -124,7 +124,7 @@ STATIC mp_obj_t ubluepy_uuid_make_new(const mp_obj_type_t *type, size_t n_args,
124124
} else {
125125
mp_raise_ValueError("Invalid UUID string length");
126126
}
127-
} else if (MP_OBJ_IS_TYPE(uuid_obj, &ubluepy_uuid_type)) {
127+
} else if (mp_obj_is_type(uuid_obj, &ubluepy_uuid_type)) {
128128
// deep copy instance
129129
ubluepy_uuid_obj_t * p_old = MP_OBJ_TO_PTR(uuid_obj);
130130
s->type = p_old->type;

Diff for: ports/stm32/adc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ STATIC mp_obj_t adc_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_
395395

396396
uint32_t channel;
397397

398-
if (MP_OBJ_IS_INT(pin_obj)) {
398+
if (mp_obj_is_int(pin_obj)) {
399399
channel = adc_get_internal_channel(mp_obj_get_int(pin_obj));
400400
} else {
401401
const pin_obj_t *pin = pin_find(pin_obj);

Diff for: ports/stm32/bufhelper.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include "bufhelper.h"
2929

3030
void pyb_buf_get_for_send(mp_obj_t o, mp_buffer_info_t *bufinfo, byte *tmp_data) {
31-
if (MP_OBJ_IS_INT(o)) {
31+
if (mp_obj_is_int(o)) {
3232
tmp_data[0] = mp_obj_get_int(o);
3333
bufinfo->buf = tmp_data;
3434
bufinfo->len = 1;
@@ -39,7 +39,7 @@ void pyb_buf_get_for_send(mp_obj_t o, mp_buffer_info_t *bufinfo, byte *tmp_data)
3939
}
4040

4141
mp_obj_t pyb_buf_get_for_recv(mp_obj_t o, vstr_t *vstr) {
42-
if (MP_OBJ_IS_INT(o)) {
42+
if (mp_obj_is_int(o)) {
4343
// allocate a new bytearray of given length
4444
vstr_init_len(vstr, mp_obj_get_int(o));
4545
return MP_OBJ_NULL;

Diff for: ports/stm32/can.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ STATIC mp_obj_t pyb_can_make_new(const mp_obj_type_t *type, size_t n_args, size_
409409

410410
// work out port
411411
mp_uint_t can_idx;
412-
if (MP_OBJ_IS_STR(args[0])) {
412+
if (mp_obj_is_str(args[0])) {
413413
const char *port = mp_obj_str_get_str(args[0]);
414414
if (0) {
415415
#ifdef MICROPY_HW_CAN1_NAME
@@ -540,7 +540,7 @@ STATIC mp_obj_t pyb_can_info(size_t n_args, const mp_obj_t *args) {
540540
if (n_args == 1) {
541541
list = MP_OBJ_TO_PTR(mp_obj_new_list(8, NULL));
542542
} else {
543-
if (!MP_OBJ_IS_TYPE(args[1], &mp_type_list)) {
543+
if (!mp_obj_is_type(args[1], &mp_type_list)) {
544544
mp_raise_TypeError(NULL);
545545
}
546546
list = MP_OBJ_TO_PTR(args[1]);
@@ -709,7 +709,7 @@ STATIC mp_obj_t pyb_can_recv(size_t n_args, const mp_obj_t *pos_args, mp_map_t *
709709
items[3] = mp_obj_new_bytes(&rx_msg.Data[0], rx_msg.DLC);
710710
} else {
711711
// User should provide a list of length at least 4 to hold the values
712-
if (!MP_OBJ_IS_TYPE(ret_obj, &mp_type_list)) {
712+
if (!mp_obj_is_type(ret_obj, &mp_type_list)) {
713713
mp_raise_TypeError(NULL);
714714
}
715715
mp_obj_list_t *list = MP_OBJ_TO_PTR(ret_obj);
@@ -719,7 +719,7 @@ STATIC mp_obj_t pyb_can_recv(size_t n_args, const mp_obj_t *pos_args, mp_map_t *
719719
items = list->items;
720720
// Fourth element must be a memoryview which we assume points to a
721721
// byte-like array which is large enough, and then we resize it inplace
722-
if (!MP_OBJ_IS_TYPE(items[3], &mp_type_memoryview)) {
722+
if (!mp_obj_is_type(items[3], &mp_type_memoryview)) {
723723
mp_raise_TypeError(NULL);
724724
}
725725
mp_obj_array_t *mv = MP_OBJ_TO_PTR(items[3]);

Diff for: ports/stm32/dac.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ STATIC mp_obj_t pyb_dac_make_new(const mp_obj_type_t *type, size_t n_args, size_
238238

239239
// get pin/channel to output on
240240
mp_int_t dac_id;
241-
if (MP_OBJ_IS_INT(args[0])) {
241+
if (mp_obj_is_int(args[0])) {
242242
dac_id = mp_obj_get_int(args[0]);
243243
} else {
244244
const pin_obj_t *pin = pin_find(args[0]);

Diff for: ports/stm32/extint.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ uint extint_register(mp_obj_t pin_obj, uint32_t mode, uint32_t pull, mp_obj_t ca
163163
const pin_obj_t *pin = NULL;
164164
uint v_line;
165165

166-
if (MP_OBJ_IS_INT(pin_obj)) {
166+
if (mp_obj_is_int(pin_obj)) {
167167
// If an integer is passed in, then use it to identify lines 16 thru 22
168168
// We expect lines 0 thru 15 to be passed in as a pin, so that we can
169169
// get both the port number and line number.
@@ -234,7 +234,7 @@ void extint_register_pin(const pin_obj_t *pin, uint32_t mode, bool hard_irq, mp_
234234
// Check if the ExtInt line is already in use by another Pin/ExtInt
235235
mp_obj_t *cb = &MP_STATE_PORT(pyb_extint_callback)[line];
236236
if (*cb != mp_const_none && MP_OBJ_FROM_PTR(pin) != pyb_extint_callback_arg[line]) {
237-
if (MP_OBJ_IS_SMALL_INT(pyb_extint_callback_arg[line])) {
237+
if (mp_obj_is_small_int(pyb_extint_callback_arg[line])) {
238238
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_OSError,
239239
"ExtInt vector %d is already in use", line));
240240
} else {

Diff for: ports/stm32/machine_i2c.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ mp_obj_t machine_hard_i2c_make_new(const mp_obj_type_t *type, size_t n_args, siz
197197

198198
// work out i2c bus
199199
int i2c_id = 0;
200-
if (MP_OBJ_IS_STR(args[ARG_id].u_obj)) {
200+
if (mp_obj_is_str(args[ARG_id].u_obj)) {
201201
const char *port = mp_obj_str_get_str(args[ARG_id].u_obj);
202202
if (0) {
203203
#ifdef MICROPY_HW_I2C1_NAME

Diff for: ports/stm32/machine_uart.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ STATIC mp_obj_t pyb_uart_make_new(const mp_obj_type_t *type, size_t n_args, size
350350

351351
// work out port
352352
int uart_id = 0;
353-
if (MP_OBJ_IS_STR(args[0])) {
353+
if (mp_obj_is_str(args[0])) {
354354
const char *port = mp_obj_str_get_str(args[0]);
355355
if (0) {
356356
#ifdef MICROPY_HW_UART1_NAME

Diff for: ports/stm32/main.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ STATIC mp_obj_t pyb_main(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_a
132132
{ MP_QSTR_opt, MP_ARG_INT, {.u_int = 0} }
133133
};
134134

135-
if (MP_OBJ_IS_STR(pos_args[0])) {
135+
if (mp_obj_is_str(pos_args[0])) {
136136
MP_STATE_PORT(pyb_config_main) = pos_args[0];
137137

138138
// parse args

0 commit comments

Comments
 (0)