Giter Site home page Giter Site logo

stinos / micropython Goto Github PK

View Code? Open in Web Editor NEW

This project forked from micropython/micropython

7.0 7.0 1.0 61.23 MB

The Micro Python project

License: Other

Makefile 1.09% C 88.91% C++ 0.40% Shell 0.22% Python 8.90% Assembly 0.11% CMake 0.34% JavaScript 0.03%

micropython's People

Contributors

alphafred avatar andrewleech avatar aykevl avatar blmorris avatar chipaca avatar danicampora avatar deshipu avatar dhylands avatar dlech avatar dpgeorge avatar flowergrass avatar glennrub avatar iabdalkader avatar jepler avatar jimmo avatar jonathanhogg avatar jongy avatar lurch avatar maureenhelm avatar mcauser avatar peterhinch avatar pfalcon avatar pi-anl avatar projectgus avatar robert-hh avatar rolandvs avatar stinos avatar takeotakahashi2020 avatar tve avatar yn386 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

gigasmartech

micropython's Issues

modffi

Hi,
i have added support in windows port for modffi.
As main mantainer of windows port i want ask you if my implementation is correct/acceptable.

i have added "libffi_msvc" from cffi (https://bitbucket.org/cffi/cffi/src/78ceec56f4dc71de69d175d8b2dee782a2da74b2/c/libffi_msvc/?at=default) and "dlfcn" from (https://github.com/dlfcn-win32/dlfcn-win32) for reuse unix/modffi.c

for do this i have modified:

unix/modffi.c:

MSVC strikes again with C99 non-compliance with varlen arrays, switching to use alloca().

232: mp_obj_t pyargs[cif->nargs]; -> mp_obj_t *pyargs = alloca(sizeof(mp_obj_t)*cif->nargs);
236: mp_obj_t res = mp_call_function_n_kw(MP_OBJ_FROM_PTR(func), cif->nargs, 0, pyargs); -> mp_obj_t res = mp_call_function_n_kw(MP_OBJ_FROM_PTR(func), cif->nargs, 0, *pyargs);
355: ffi_arg values[n_args]; -> ffi_arg *values = alloca(sizeof(ffi_arg)*n_args);
356: void *valueptrs[n_args]; -> void **valueptrs = alloca(sizeof(void *)*n_args);

windows/micropython.vcxproj:

to support "dlfcn"

80: ->
psapi.lib;%(AdditionalDependencies)

84: ->
psapi.lib;%(AdditionalDependencies)

windows/mpconfigport.h:

added:
171: extern const struct _mp_obj_module_t mp_module_ffi;
175: { MP_ROM_QSTR(MP_QSTR_ffi), MP_ROM_PTR(&mp_module_ffi) }, \

windows/paths.props:

31: $(PyBaseDir);$(PyWinDir);$(PyBuildDir);$(PyWinDir)msvc -> $(PyBaseDir);$(PyWinDir);$(PyBuildDir);$(PyWinDir)msvc;$(PyWinDir)libffi_msvc

windows/sources.props:

added:
8:
14:
38:

Any hint on this?

Regards,
D.

mod_name in mp_load_dynlib

Hi,
I was trying to use your code to load some .so modules on Linux and it works. But I had to make some changes.
You required the .so to expose a function names "init_<module_name>()", which works in the scenario of "import module_name". But in a lot of places people do "from pkg_name import module_name", in this scenario, the mod_name passed in to mp_load_dynlib is actually <pkg_name>.<module_name> which makes init_<mod_name> an invalid C function name.
My workaround was to search for the last "." in mod_name and only used the rest of the string to be the init function name.

What is it? How i can this solve?

I unziped packages. In terminal did:
$cd /unix
$make
After this steps I saw:
$API MP_DECLARE_CONST_FUN_OBJ(mp_identity_obj);
$ ^
$make: *** [build/py/gc.o] Error 1
PS: Sorry for my bad English. I am russian beginer programmist

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.