aboutsummaryrefslogtreecommitdiff
path: root/stmhal
diff options
context:
space:
mode:
authorDamien George2014-03-30 13:35:08 +0100
committerDamien George2014-03-30 13:35:08 +0100
commitd17926db710189db97a49e9b2e72d782fc404231 (patch)
tree406396ee6f3010511a606dd4ea3ed5a817d959eb /stmhal
parent09d207785c77c85c957471b064ceebe0d2ee0a23 (diff)
Rename rt_* to mp_*.
Mostly just a global search and replace. Except rt_is_true which becomes mp_obj_is_true. Still would like to tidy up some of the names, but this will do for now.
Diffstat (limited to 'stmhal')
-rw-r--r--stmhal/accel.c4
-rw-r--r--stmhal/adc.c2
-rw-r--r--stmhal/dac.c2
-rw-r--r--stmhal/exti.c4
-rw-r--r--stmhal/gpio.c2
-rw-r--r--stmhal/i2c.c2
-rw-r--r--stmhal/lcd.c20
-rw-r--r--stmhal/led.c2
-rw-r--r--stmhal/main.c4
-rw-r--r--stmhal/pin_map.c6
-rw-r--r--stmhal/pyexec.c6
-rw-r--r--stmhal/sdcard.c2
-rw-r--r--stmhal/servo.c2
-rw-r--r--stmhal/usrsw.c2
14 files changed, 30 insertions, 30 deletions
diff --git a/stmhal/accel.c b/stmhal/accel.c
index c77ec5c51..a564902c0 100644
--- a/stmhal/accel.c
+++ b/stmhal/accel.c
@@ -76,7 +76,7 @@ STATIC pyb_accel_obj_t pyb_accel_obj;
STATIC mp_obj_t pyb_accel_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) {
// check arguments
- rt_check_nargs(n_args, 0, 0, n_kw, false);
+ mp_check_nargs(n_args, 0, 0, n_kw, false);
// init accel object
pyb_accel_obj.base.type = &pyb_accel_type;
@@ -135,7 +135,7 @@ STATIC mp_obj_t pyb_accel_filtered_xyz(mp_obj_t self_in) {
tuple[i] = mp_obj_new_int(val);
}
- return rt_build_tuple(3, tuple);
+ return mp_build_tuple(3, tuple);
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(pyb_accel_filtered_xyz_obj, pyb_accel_filtered_xyz);
diff --git a/stmhal/adc.c b/stmhal/adc.c
index d28392c89..c4e0b9e25 100644
--- a/stmhal/adc.c
+++ b/stmhal/adc.c
@@ -119,7 +119,7 @@ STATIC void adc_print(void (*print)(void *env, const char *fmt, ...), void *env,
STATIC mp_obj_t adc_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) {
// check number of arguments
- rt_check_nargs(n_args, 1, 1, n_kw, false);
+ mp_check_nargs(n_args, 1, 1, n_kw, false);
// 1st argument is the pin name
mp_obj_t pin_obj = args[0];
diff --git a/stmhal/dac.c b/stmhal/dac.c
index 8bbab35be..b57e2c440 100644
--- a/stmhal/dac.c
+++ b/stmhal/dac.c
@@ -65,7 +65,7 @@ STATIC pyb_dac_obj_t pyb_dac_channel_2 = {{&pyb_dac_type}, DAC_CHANNEL_2, DMA1_S
STATIC mp_obj_t pyb_dac_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) {
// check arguments
- rt_check_nargs(n_args, 1, 1, n_kw, false);
+ mp_check_nargs(n_args, 1, 1, n_kw, false);
machine_int_t dac_id = mp_obj_get_int(args[0]);
uint32_t pin;
diff --git a/stmhal/exti.c b/stmhal/exti.c
index e5e9b53bd..99bcd07e8 100644
--- a/stmhal/exti.c
+++ b/stmhal/exti.c
@@ -264,7 +264,7 @@ STATIC MP_DEFINE_CONST_DICT(exti_locals_dict, exti_locals_dict_table);
STATIC mp_obj_t exti_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) {
// type_in == exti_obj_type
- rt_check_nargs(n_args, 4, 4, n_kw, false);
+ mp_check_nargs(n_args, 4, 4, n_kw, false);
exti_obj_t *self = m_new_obj(exti_obj_t);
self->base.type = type_in;
@@ -305,7 +305,7 @@ void Handle_EXTI_Irq(uint32_t line) {
exti_vector_t *v = &exti_vector[line];
if (v->callback_obj != mp_const_none) {
// TODO need to wrap this in an nlr_buf; really need a general function for this
- rt_call_function_1(v->callback_obj, MP_OBJ_NEW_SMALL_INT(line));
+ mp_call_function_1(v->callback_obj, MP_OBJ_NEW_SMALL_INT(line));
}
}
}
diff --git a/stmhal/gpio.c b/stmhal/gpio.c
index be1249b37..4548dca58 100644
--- a/stmhal/gpio.c
+++ b/stmhal/gpio.c
@@ -27,7 +27,7 @@ mp_obj_t pyb_gpio(uint n_args, mp_obj_t *args) {
}
// set pin
- HAL_GPIO_WritePin(pin->gpio, pin->pin_mask, rt_is_true(args[1]));
+ HAL_GPIO_WritePin(pin->gpio, pin->pin_mask, mp_obj_is_true(args[1]));
return mp_const_none;
}
diff --git a/stmhal/i2c.c b/stmhal/i2c.c
index ab37f756b..0b76d35cb 100644
--- a/stmhal/i2c.c
+++ b/stmhal/i2c.c
@@ -80,7 +80,7 @@ STATIC pyb_i2c_obj_t pyb_i2c_obj[PYB_NUM_I2C] = {{{&pyb_i2c_type}, &I2cHandle_X}
STATIC mp_obj_t pyb_i2c_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) {
// check arguments
- rt_check_nargs(n_args, 1, 1, n_kw, false);
+ mp_check_nargs(n_args, 1, 1, n_kw, false);
// get i2c number
machine_int_t i2c_id = mp_obj_get_int(args[0]) - 1;
diff --git a/stmhal/lcd.c b/stmhal/lcd.c
index e2b9e2297..efee13d23 100644
--- a/stmhal/lcd.c
+++ b/stmhal/lcd.c
@@ -214,7 +214,7 @@ mp_obj_t lcd_print(mp_obj_t text) {
mp_obj_t lcd_light(mp_obj_t value) {
#if defined(PYB_LCD_BL_PORT)
- if (rt_is_true(value)) {
+ if (mp_obj_is_true(value)) {
PYB_LCD_BL_PORT->BSRRL = PYB_LCD_BL_PIN; // set pin high to turn backlight on
} else {
PYB_LCD_BL_PORT->BSRRH = PYB_LCD_BL_PIN; // set pin low to turn backlight off
@@ -291,14 +291,14 @@ static mp_obj_t pyb_lcd_init(void) {
// Micro Python interface
mp_obj_t o = mp_obj_new_type(MP_QSTR_LCD, mp_const_empty_tuple, mp_obj_new_dict(0));
- rt_store_attr(o, qstr_from_str("lcd8"), rt_make_function_n(2, lcd_draw_pixel_8));
- rt_store_attr(o, qstr_from_str("clear"), rt_make_function_n(0, lcd_pix_clear));
- rt_store_attr(o, qstr_from_str("get"), rt_make_function_n(2, lcd_pix_get));
- rt_store_attr(o, qstr_from_str("set"), rt_make_function_n(2, lcd_pix_set));
- rt_store_attr(o, qstr_from_str("reset"), rt_make_function_n(2, lcd_pix_reset));
- rt_store_attr(o, qstr_from_str("show"), rt_make_function_n(0, lcd_pix_show));
- rt_store_attr(o, qstr_from_str("text"), rt_make_function_n(1, lcd_print));
- rt_store_attr(o, qstr_from_str("light"), rt_make_function_n(1, lcd_light));
+ mp_store_attr(o, qstr_from_str("lcd8"), mp_make_function_n(2, lcd_draw_pixel_8));
+ mp_store_attr(o, qstr_from_str("clear"), mp_make_function_n(0, lcd_pix_clear));
+ mp_store_attr(o, qstr_from_str("get"), mp_make_function_n(2, lcd_pix_get));
+ mp_store_attr(o, qstr_from_str("set"), mp_make_function_n(2, lcd_pix_set));
+ mp_store_attr(o, qstr_from_str("reset"), mp_make_function_n(2, lcd_pix_reset));
+ mp_store_attr(o, qstr_from_str("show"), mp_make_function_n(0, lcd_pix_show));
+ mp_store_attr(o, qstr_from_str("text"), mp_make_function_n(1, lcd_print));
+ mp_store_attr(o, qstr_from_str("light"), mp_make_function_n(1, lcd_light));
mp_lcd = o;
return o;
}
@@ -307,7 +307,7 @@ static MP_DEFINE_CONST_FUN_OBJ_0(pyb_lcd_init_obj, pyb_lcd_init);
void lcd_init(void) {
mp_lcd = MP_OBJ_NULL;
- rt_store_name(qstr_from_str("LCD"), (mp_obj_t)&pyb_lcd_init_obj);
+ mp_store_name(qstr_from_str("LCD"), (mp_obj_t)&pyb_lcd_init_obj);
}
void lcd_print_str(const char *str) {
diff --git a/stmhal/led.c b/stmhal/led.c
index 506e82e54..995b518e2 100644
--- a/stmhal/led.c
+++ b/stmhal/led.c
@@ -208,7 +208,7 @@ void led_obj_print(void (*print)(void *env, const char *fmt, ...), void *env, mp
STATIC mp_obj_t led_obj_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) {
// check arguments
- rt_check_nargs(n_args, 1, 1, n_kw, false);
+ mp_check_nargs(n_args, 1, 1, n_kw, false);
// get led number
machine_int_t led_id = mp_obj_get_int(args[0]) - 1;
diff --git a/stmhal/main.c b/stmhal/main.c
index 9efaaec76..d6d9b9ed7 100644
--- a/stmhal/main.c
+++ b/stmhal/main.c
@@ -251,12 +251,12 @@ soft_reset:
// Micro Python init
qstr_init();
- rt_init();
+ mp_init();
mp_obj_t def_path[3];
def_path[0] = MP_OBJ_NEW_QSTR(MP_QSTR_0_colon__slash_);
def_path[1] = MP_OBJ_NEW_QSTR(MP_QSTR_0_colon__slash_src);
def_path[2] = MP_OBJ_NEW_QSTR(MP_QSTR_0_colon__slash_lib);
- sys_path = mp_obj_new_list(3, def_path);
+ mp_sys_path = mp_obj_new_list(3, def_path);
readline_init();
diff --git a/stmhal/pin_map.c b/stmhal/pin_map.c
index a754d24a0..8a0be1d52 100644
--- a/stmhal/pin_map.c
+++ b/stmhal/pin_map.c
@@ -69,7 +69,7 @@ static void pin_map_obj_print(void (*print)(void *env, const char *fmt, ...), vo
static mp_obj_t pin_map_call(mp_obj_t self_in, uint n_args, uint n_kw, const mp_obj_t *args) {
pin_map_obj_t *self = self_in;
- rt_check_nargs(n_args, 1, 2, n_kw, false);
+ mp_check_nargs(n_args, 1, 2, n_kw, false);
if (n_args > 1) {
if (!self->map_dict) {
@@ -96,7 +96,7 @@ static MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(pin_map_obj_mapper_obj, 1, 2, pin_map
static mp_obj_t pin_map_obj_debug(uint n_args, mp_obj_t *args) {
pin_map_obj_t *self = args[0];
if (n_args > 1) {
- self->debug = rt_is_true(args[1]);
+ self->debug = mp_obj_is_true(args[1]);
return mp_const_none;
}
return MP_BOOL(self->debug);
@@ -162,7 +162,7 @@ const pin_obj_t *pin_map_user_obj(mp_obj_t user_obj) {
}
if (pin_map_obj.mapper) {
- pin_obj = rt_call_function_1(pin_map_obj.mapper, user_obj);
+ pin_obj = mp_call_function_1(pin_map_obj.mapper, user_obj);
if (pin_obj != mp_const_none) {
if (!MP_OBJ_IS_TYPE(pin_obj, &pin_obj_type)) {
nlr_jump(mp_obj_new_exception_msg(&mp_type_ValueError, "Pin.mapper didn't return a Pin object"));
diff --git a/stmhal/pyexec.c b/stmhal/pyexec.c
index 7c19d45ca..ffee4dd2e 100644
--- a/stmhal/pyexec.c
+++ b/stmhal/pyexec.c
@@ -55,7 +55,7 @@ bool parse_compile_execute(mp_lexer_t *lex, mp_parse_input_kind_t input_kind, bo
uint32_t start = HAL_GetTick();
if (nlr_push(&nlr) == 0) {
usb_vcp_set_interrupt_char(VCP_CHAR_CTRL_C); // allow ctrl-C to interrupt us
- rt_call_function_0(module_fun);
+ mp_call_function_0(module_fun);
usb_vcp_set_interrupt_char(VCP_CHAR_NONE); // disable interrupt
nlr_pop();
ret = true;
@@ -151,8 +151,8 @@ int pyexec_friendly_repl(void) {
#if defined(USE_HOST_MODE) && MICROPY_HW_HAS_LCD
// in host mode, we enable the LCD for the repl
- mp_obj_t lcd_o = rt_call_function_0(rt_load_name(qstr_from_str("LCD")));
- rt_call_function_1(rt_load_attr(lcd_o, qstr_from_str("light")), mp_const_true);
+ mp_obj_t lcd_o = mp_call_function_0(mp_load_name(qstr_from_str("LCD")));
+ mp_call_function_1(mp_load_attr(lcd_o, qstr_from_str("light")), mp_const_true);
#endif
friendly_repl_reset:
diff --git a/stmhal/sdcard.c b/stmhal/sdcard.c
index ae03c9f3f..84ee0b7b1 100644
--- a/stmhal/sdcard.c
+++ b/stmhal/sdcard.c
@@ -209,7 +209,7 @@ static MP_DEFINE_CONST_FUN_OBJ_1(sd_present_obj, sd_present);
static mp_obj_t sd_power(mp_obj_t self, mp_obj_t state) {
bool result;
- if (rt_is_true(state)) {
+ if (mp_obj_is_true(state)) {
result = sdcard_power_on();
} else {
sdcard_power_off();
diff --git a/stmhal/servo.c b/stmhal/servo.c
index 595532858..4e8ff1543 100644
--- a/stmhal/servo.c
+++ b/stmhal/servo.c
@@ -157,7 +157,7 @@ STATIC void pyb_servo_print(void (*print)(void *env, const char *fmt, ...), void
STATIC mp_obj_t pyb_servo_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) {
// check arguments
- rt_check_nargs(n_args, 1, 1, n_kw, false);
+ mp_check_nargs(n_args, 1, 1, n_kw, false);
// get servo number
machine_int_t servo_id = mp_obj_get_int(args[0]) - 1;
diff --git a/stmhal/usrsw.c b/stmhal/usrsw.c
index 038fbf9ef..453c3dfa8 100644
--- a/stmhal/usrsw.c
+++ b/stmhal/usrsw.c
@@ -33,7 +33,7 @@ static mp_obj_t switch_user_callback_obj;
static mp_obj_t switch_callback(mp_obj_t line) {
if (switch_user_callback_obj != mp_const_none) {
- rt_call_function_0(switch_user_callback_obj);
+ mp_call_function_0(switch_user_callback_obj);
}
return mp_const_none;
}