Comments (4)
I've performed some research and it looks like this is because it's called first as a library CTOR and second time as a Python/JS module initialization subroutine due to line 29 in mraa.i, where we explicitly ask SWIG to call mraa_init() during module initialization.
I'm not yet that much into SWIG to understand all consequences, but after reading the basic docs and analyzing this from a common sense standpoint :) - if we have it defined as CTOR and libc does call it for us anyway, there's no point in having it in the SWIG %init section.
What do you think?
from mraa.
Would make sense to me. The mraa.i might not have been updated when the CTOR was added.
Gave it a quick test, removed the init section around line 29 and the modules still works. (At least python)
from mraa.
ehehe that didn't require much research, I know that. The problem is that I fixed this issue with eec08ac by adding a "nice" #ifndef. The reason for keeping it in %init is historical (ctors came after) and also because ctors get called extremely early and it's a little cleaner IMHO than the rather brutal ctor behaviour. Also we can do cool stuff if %init fails. But yes that would fix the issue.
But really the issue is why #if (defined SWIGPYTHON) || (defined SWIG)
doesn't work. Which does worry me - a little. Also that statement should probably be just SWIG
.
from mraa.
Ok, I see. That would've been too easy :) Indeed it does seem to ignore these there, I've just tried several variations. Looks like some deeper digging is in order here.
from mraa.
Related Issues (20)
- Wish: Foreign OS support / cooperation HOT 1
- add compute module 3 / 3 plus support
- add raspberry pi compute module 4 variants HOT 3
- mraa_iio_detect() memory leak
- Possible support for Adafruit ft232h on Linux x86 desktop HOT 2
- UART initialization failed on Raspberry Pi 4
- mraa_uart_write(): off by one while writing arrays HOT 1
- mraa_uart_set_flowcontrol(): rogue XOFF byte
- Add build/release branch for jammy (Ubuntu 22.04[.1] LTS) HOT 2
- SIGINT results in segfault (C code) as thread gets terminated
- RISC-V linux platform support HOT 2
- Unable to detect GPIO pins in python HOT 2
- IEI tank detect pins with ISMMPlus but cant detect pins with mraa HOT 1
- RPC for MRAA
- Support for RockPi 4C Plus
- Support for GPIO uAPI V2.
- RockPi4 Pull Up
- g++: types.h compilation warning -Wundef
- First UART message starts with hex 13
- GPIO Interrupt problem on CM3 HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mraa.