maa.i: maa_init is now done after swig initialisation routine
authorBrendan Le Foll <brendan.le.foll@intel.com>
Wed, 7 May 2014 16:39:58 +0000 (17:39 +0100)
committerBrendan Le Foll <brendan.le.foll@intel.com>
Wed, 7 May 2014 16:39:58 +0000 (17:39 +0100)
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
examples/python/blink-io8.py
examples/python/cycle-pwm3.py
examples/python/hello_gpio.py
examples/python/readi2c.py
src/maa.i

index c03380f..70ab740 100644 (file)
@@ -25,7 +25,6 @@
 import pymaa as maa
 import time
 
-maa.init()
 x = maa.Gpio(8)
 x.dir(maa.MAA_GPIO_OUT)
 
index c90351a..290d16f 100644 (file)
@@ -25,7 +25,6 @@
 import pymaa as maa
 import time
 
-maa.init()
 x = maa.PWM(0,3)
 x.enable(1);
 x.period_us(20)
index 008fb00..0698c5b 100644 (file)
@@ -24,6 +24,5 @@
 
 import pymaa
 
-pumaa.init()
 x = pymaa.Gpio(13)
 print(x.pin)
index 6f5ac4b..6f65806 100644 (file)
@@ -24,7 +24,6 @@
 
 import pymaa as maa
 
-maa.init()
 x = maa.I2c()
 x.address(0x62)
 y= "  "
index b0b9d72..95cdb78 100644 (file)
--- a/src/maa.i
+++ b/src/maa.i
@@ -7,10 +7,12 @@
     #include "aio.h"
 %}
 
+%init %{
+    maa_init();
+%}
+
 %rename(get_version) maa_get_version();
 const char * maa_get_version();
-%rename(init) maa_init();
-int maa_init();
 
 #### GPIO ####