diff options
Diffstat (limited to 'stm')
-rw-r--r-- | stm/audio.c | 6 | ||||
-rw-r--r-- | stm/lcd.c | 14 | ||||
-rw-r--r-- | stm/main.c | 42 | ||||
-rw-r--r-- | stm/pybwlan.c | 10 | ||||
-rw-r--r-- | stm/timer.c | 8 |
5 files changed, 40 insertions, 40 deletions
diff --git a/stm/audio.c b/stm/audio.c index 34adefbcd6..e2aa32b9fc 100644 --- a/stm/audio.c +++ b/stm/audio.c @@ -91,8 +91,8 @@ void audio_init(void) { // Python interface mp_obj_t m = mp_obj_new_module(qstr_from_str_static("audio")); - rt_store_attr(m, qstr_from_str_static("dac"), rt_make_function_1(pyb_audio_dac)); - rt_store_attr(m, qstr_from_str_static("is_full"), rt_make_function_0(pyb_audio_is_full)); - rt_store_attr(m, qstr_from_str_static("fill"), rt_make_function_1(pyb_audio_fill)); + rt_store_attr(m, qstr_from_str_static("dac"), rt_make_function_n(1, pyb_audio_dac)); + rt_store_attr(m, qstr_from_str_static("is_full"), rt_make_function_n(0, pyb_audio_is_full)); + rt_store_attr(m, qstr_from_str_static("fill"), rt_make_function_n(1, pyb_audio_fill)); rt_store_name(qstr_from_str_static("audio"), m); } @@ -220,13 +220,13 @@ void lcd_init(void) { // Python interface mp_obj_t m = mp_obj_new_module(qstr_from_str_static("lcd")); - rt_store_attr(m, qstr_from_str_static("lcd8"), rt_make_function_2(lcd_draw_pixel_8)); - rt_store_attr(m, qstr_from_str_static("clear"), rt_make_function_0(lcd_pix_clear)); - rt_store_attr(m, qstr_from_str_static("get"), rt_make_function_2(lcd_pix_get)); - rt_store_attr(m, qstr_from_str_static("set"), rt_make_function_2(lcd_pix_set)); - rt_store_attr(m, qstr_from_str_static("reset"), rt_make_function_2(lcd_pix_reset)); - rt_store_attr(m, qstr_from_str_static("show"), rt_make_function_0(lcd_pix_show)); - rt_store_attr(m, qstr_from_str_static("text"), rt_make_function_1(lcd_print)); + rt_store_attr(m, qstr_from_str_static("lcd8"), rt_make_function_n(2, lcd_draw_pixel_8)); + rt_store_attr(m, qstr_from_str_static("clear"), rt_make_function_n(0, lcd_pix_clear)); + rt_store_attr(m, qstr_from_str_static("get"), rt_make_function_n(2, lcd_pix_get)); + rt_store_attr(m, qstr_from_str_static("set"), rt_make_function_n(2, lcd_pix_set)); + rt_store_attr(m, qstr_from_str_static("reset"), rt_make_function_n(2, lcd_pix_reset)); + rt_store_attr(m, qstr_from_str_static("show"), rt_make_function_n(0, lcd_pix_show)); + rt_store_attr(m, qstr_from_str_static("text"), rt_make_function_n(1, lcd_print)); rt_store_name(qstr_from_str_static("lcd"), m); } diff --git a/stm/main.c b/stm/main.c index cdc4432c09..2085182c29 100644 --- a/stm/main.c +++ b/stm/main.c @@ -812,36 +812,36 @@ soft_reset: // add some functions to the python namespace { - rt_store_name(qstr_from_str_static("help"), rt_make_function_0(pyb_help)); + rt_store_name(qstr_from_str_static("help"), rt_make_function_n(0, pyb_help)); mp_obj_t m = mp_obj_new_module(qstr_from_str_static("pyb")); - rt_store_attr(m, qstr_from_str_static("info"), rt_make_function_0(pyb_info)); - rt_store_attr(m, qstr_from_str_static("sd_test"), rt_make_function_0(pyb_sd_test)); - rt_store_attr(m, qstr_from_str_static("stop"), rt_make_function_0(pyb_stop)); - rt_store_attr(m, qstr_from_str_static("standby"), rt_make_function_0(pyb_standby)); - rt_store_attr(m, qstr_from_str_static("source_dir"), rt_make_function_1(pyb_source_dir)); - rt_store_attr(m, qstr_from_str_static("main"), rt_make_function_1(pyb_main)); - rt_store_attr(m, qstr_from_str_static("sync"), rt_make_function_0(pyb_sync)); - rt_store_attr(m, qstr_from_str_static("gc"), rt_make_function_0(pyb_gc)); - rt_store_attr(m, qstr_from_str_static("delay"), rt_make_function_1(pyb_delay)); - rt_store_attr(m, qstr_from_str_static("led"), rt_make_function_1(pyb_led)); + rt_store_attr(m, qstr_from_str_static("info"), rt_make_function_n(0, pyb_info)); + rt_store_attr(m, qstr_from_str_static("sd_test"), rt_make_function_n(0, pyb_sd_test)); + rt_store_attr(m, qstr_from_str_static("stop"), rt_make_function_n(0, pyb_stop)); + rt_store_attr(m, qstr_from_str_static("standby"), rt_make_function_n(0, pyb_standby)); + rt_store_attr(m, qstr_from_str_static("source_dir"), rt_make_function_n(1, pyb_source_dir)); + rt_store_attr(m, qstr_from_str_static("main"), rt_make_function_n(1, pyb_main)); + rt_store_attr(m, qstr_from_str_static("sync"), rt_make_function_n(0, pyb_sync)); + rt_store_attr(m, qstr_from_str_static("gc"), rt_make_function_n(0, pyb_gc)); + rt_store_attr(m, qstr_from_str_static("delay"), rt_make_function_n(1, pyb_delay)); + rt_store_attr(m, qstr_from_str_static("led"), rt_make_function_n(1, pyb_led)); rt_store_attr(m, qstr_from_str_static("switch"), (mp_obj_t)&pyb_switch_obj); - rt_store_attr(m, qstr_from_str_static("servo"), rt_make_function_2(pyb_servo_set)); - rt_store_attr(m, qstr_from_str_static("pwm"), rt_make_function_2(pyb_pwm_set)); + rt_store_attr(m, qstr_from_str_static("servo"), rt_make_function_n(2, pyb_servo_set)); + rt_store_attr(m, qstr_from_str_static("pwm"), rt_make_function_n(2, pyb_pwm_set)); rt_store_attr(m, qstr_from_str_static("accel"), (mp_obj_t)&pyb_mma_read_obj); rt_store_attr(m, qstr_from_str_static("mma_read"), (mp_obj_t)&pyb_mma_read_all_obj); rt_store_attr(m, qstr_from_str_static("mma_mode"), (mp_obj_t)&pyb_mma_write_mode_obj); - rt_store_attr(m, qstr_from_str_static("hid"), rt_make_function_1(pyb_hid_send_report)); - rt_store_attr(m, qstr_from_str_static("time"), rt_make_function_0(pyb_rtc_read)); - rt_store_attr(m, qstr_from_str_static("rand"), rt_make_function_0(pyb_rng_get)); - rt_store_attr(m, qstr_from_str_static("Led"), rt_make_function_1(pyb_Led)); - rt_store_attr(m, qstr_from_str_static("Servo"), rt_make_function_1(pyb_Servo)); - rt_store_attr(m, qstr_from_str_static("I2C"), rt_make_function_2(pyb_I2C)); + rt_store_attr(m, qstr_from_str_static("hid"), rt_make_function_n(1, pyb_hid_send_report)); + rt_store_attr(m, qstr_from_str_static("time"), rt_make_function_n(0, pyb_rtc_read)); + rt_store_attr(m, qstr_from_str_static("rand"), rt_make_function_n(0, pyb_rng_get)); + rt_store_attr(m, qstr_from_str_static("Led"), rt_make_function_n(1, pyb_Led)); + rt_store_attr(m, qstr_from_str_static("Servo"), rt_make_function_n(1, pyb_Servo)); + rt_store_attr(m, qstr_from_str_static("I2C"), rt_make_function_n(2, pyb_I2C)); rt_store_attr(m, qstr_from_str_static("gpio"), (mp_obj_t)&pyb_gpio_obj); - rt_store_attr(m, qstr_from_str_static("Usart"), rt_make_function_2(pyb_Usart)); + rt_store_attr(m, qstr_from_str_static("Usart"), rt_make_function_n(2, pyb_Usart)); rt_store_name(qstr_from_str_static("pyb"), m); - rt_store_name(qstr_from_str_static("open"), rt_make_function_2(pyb_io_open)); + rt_store_name(qstr_from_str_static("open"), rt_make_function_n(2, pyb_io_open)); } // print a message to the LCD diff --git a/stm/pybwlan.c b/stm/pybwlan.c index 09d642d9c8..91d71a652b 100644 --- a/stm/pybwlan.c +++ b/stm/pybwlan.c @@ -357,11 +357,11 @@ void pyb_wlan_init(void) { mp_obj_t m = mp_obj_new_module(qstr_from_str_static("wlan")); rt_store_attr(m, qstr_from_str_static("connect"), rt_make_function_var(0, pyb_wlan_connect)); - rt_store_attr(m, qstr_from_str_static("disconnect"), rt_make_function_0(pyb_wlan_disconnect)); - rt_store_attr(m, qstr_from_str_static("ip"), rt_make_function_0(pyb_wlan_get_ip)); - rt_store_attr(m, qstr_from_str_static("get_host"), rt_make_function_1(pyb_wlan_get_host)); - rt_store_attr(m, qstr_from_str_static("http_get"), rt_make_function_2(pyb_wlan_http_get)); - rt_store_attr(m, qstr_from_str_static("serve"), rt_make_function_0(pyb_wlan_serve)); + rt_store_attr(m, qstr_from_str_static("disconnect"), rt_make_function_n(0, pyb_wlan_disconnect)); + rt_store_attr(m, qstr_from_str_static("ip"), rt_make_function_n(0, pyb_wlan_get_ip)); + rt_store_attr(m, qstr_from_str_static("get_host"), rt_make_function_n(1, pyb_wlan_get_host)); + rt_store_attr(m, qstr_from_str_static("http_get"), rt_make_function_n(2, pyb_wlan_http_get)); + rt_store_attr(m, qstr_from_str_static("serve"), rt_make_function_n(0, pyb_wlan_serve)); rt_store_name(qstr_from_str_static("wlan"), m); } diff --git a/stm/timer.c b/stm/timer.c index 2605d4b4bc..c665a461d0 100644 --- a/stm/timer.c +++ b/stm/timer.c @@ -72,10 +72,10 @@ void timer_init(void) { // Python interface mp_obj_t m = mp_obj_new_module(qstr_from_str_static("timer")); - rt_store_attr(m, qstr_from_str_static("callback"), rt_make_function_1(timer_py_set_callback)); - rt_store_attr(m, qstr_from_str_static("period"), rt_make_function_1(timer_py_set_period)); - rt_store_attr(m, qstr_from_str_static("prescaler"), rt_make_function_1(timer_py_set_prescaler)); - rt_store_attr(m, qstr_from_str_static("value"), rt_make_function_0(timer_py_get_value)); + rt_store_attr(m, qstr_from_str_static("callback"), rt_make_function_n(1, timer_py_set_callback)); + rt_store_attr(m, qstr_from_str_static("period"), rt_make_function_n(1, timer_py_set_period)); + rt_store_attr(m, qstr_from_str_static("prescaler"), rt_make_function_n(1, timer_py_set_prescaler)); + rt_store_attr(m, qstr_from_str_static("value"), rt_make_function_n(0, timer_py_get_value)); rt_store_name(qstr_from_str_static("timer"), m); } |