From 83a5e6cde82b7373fe746515d0a1cad9727677e8 Mon Sep 17 00:00:00 2001 From: Brendan Le Foll Date: Wed, 7 May 2014 17:39:58 +0100 Subject: [PATCH] maa.i: maa_init is now done after swig initialisation routine Signed-off-by: Brendan Le Foll --- examples/python/blink-io8.py | 1 - examples/python/cycle-pwm3.py | 1 - examples/python/hello_gpio.py | 1 - examples/python/readi2c.py | 1 - src/maa.i | 6 ++++-- 5 files changed, 4 insertions(+), 6 deletions(-) diff --git a/examples/python/blink-io8.py b/examples/python/blink-io8.py index c03380f..70ab740 100644 --- a/examples/python/blink-io8.py +++ b/examples/python/blink-io8.py @@ -25,7 +25,6 @@ import pymaa as maa import time -maa.init() x = maa.Gpio(8) x.dir(maa.MAA_GPIO_OUT) diff --git a/examples/python/cycle-pwm3.py b/examples/python/cycle-pwm3.py index c90351a..290d16f 100644 --- a/examples/python/cycle-pwm3.py +++ b/examples/python/cycle-pwm3.py @@ -25,7 +25,6 @@ import pymaa as maa import time -maa.init() x = maa.PWM(0,3) x.enable(1); x.period_us(20) diff --git a/examples/python/hello_gpio.py b/examples/python/hello_gpio.py index 008fb00..0698c5b 100644 --- a/examples/python/hello_gpio.py +++ b/examples/python/hello_gpio.py @@ -24,6 +24,5 @@ import pymaa -pumaa.init() x = pymaa.Gpio(13) print(x.pin) diff --git a/examples/python/readi2c.py b/examples/python/readi2c.py index 6f5ac4b..6f65806 100644 --- a/examples/python/readi2c.py +++ b/examples/python/readi2c.py @@ -24,7 +24,6 @@ import pymaa as maa -maa.init() x = maa.I2c() x.address(0x62) y= " " diff --git a/src/maa.i b/src/maa.i index b0b9d72..95cdb78 100644 --- 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 #### -- 2.7.4