From 8a91d9f6d4a284529f4cfbf90c6a4f15eb7c9764 Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Thu, 13 Feb 2014 03:17:51 +0200 Subject: [PATCH] Export imlib module --- src/main.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main.c b/src/main.c index 40b94be38..3fd662175 100644 --- a/src/main.c +++ b/src/main.c @@ -18,6 +18,7 @@ #include "sensor.h" #include "py_led.h" #include "py_sensor.h" +#include "py_imlib.h" int errno; @@ -61,9 +62,9 @@ static const char fresh_main_py[] = "from openmv import led\n" "while(openmv.vcp_connected()==0):\n" " led.on(led.BLUE)\n" -" openmv.delay(500)\n" +" delay(500)\n" " led.off(led.BLUE)\n" -" openmv.delay(500)\n" +" delay(500)\n" ; static const char *help_text = @@ -223,6 +224,7 @@ int main(void) /* add some functions to the python namespace */ rt_store_name(MP_QSTR_help, rt_make_function_n(0, pyb_help)); + rt_store_name(MP_QSTR_delay, rt_make_function_n(1, pyb_delay)); /* Create main module */ mp_obj_t m = mp_obj_new_module(qstr_from_str("openmv")); @@ -232,14 +234,15 @@ int main(void) rt_store_attr(m, MP_QSTR_stop, rt_make_function_n(0, pyb_stop)); rt_store_attr(m, MP_QSTR_standby, rt_make_function_n(0, pyb_standby)); rt_store_attr(m, MP_QSTR_sync, rt_make_function_n(0, pyb_sync)); - rt_store_attr(m, MP_QSTR_delay, rt_make_function_n(1, pyb_delay)); - mp_obj_t led_module = py_led_init(); rt_store_attr(m, qstr_from_str("led"), led_module); mp_obj_t sensor_module = py_sensor_init(); rt_store_attr(m, qstr_from_str("sensor"), sensor_module); + mp_obj_t imlib_module = py_imlib_init(); + rt_store_attr(m, qstr_from_str("imlib"), imlib_module); + rt_store_name(qstr_from_str("openmv"), m); /* Try to mount the flash fs */