Search found 735 matches
- Mon Apr 18, 2022 7:24 am
- Forum: Development of MicroPython
- Topic: C++ native modules for Micropython?
- Replies: 5
- Views: 2948
Re: C++ native modules for Micropython?
Yes the firmware in that case contains everything. 'rebuild' is perhaps not the best word for it, IIRC the Makefile is smart enough to figure out that if you only change one source file of the module it's only going to build/link that object file.
- Sun Apr 17, 2022 6:58 am
- Forum: Development of MicroPython
- Topic: C++ native modules for Micropython?
- Replies: 5
- Views: 2948
Re: C++ native modules for Micropython?
Do you really need native modules? 'user modules' are quite a lot easier to work with, plus have C++ examples: examples/usercmodules/cppexample. And micrpython-wrap also works that way.I tried converting the features0 example in examples/natmod
- Fri Mar 04, 2022 7:37 pm
- Forum: General Discussion and Questions
- Topic: TypeError: can't convert __enter__ to float
- Replies: 5
- Views: 1973
Re: TypeError: can't convert __enter__ to float
Code: Select all
(x, y, z) = self.raw_values
Code: Select all
(x, y, z) = self.raw_values()
- Fri Mar 04, 2022 7:33 pm
- Forum: Raspberry Pi microcontroller boards
- Topic: How to organize code
- Replies: 5
- Views: 2065
Re: How to organize code
Bit hard to tell, but sounds ok to me to put those arrays in a separate module for clarity; doesn't necessarily mean they should be globals though: you could have functions like def LargeArrayA(): return [......] def LargeArrayB(): return [......] But that's just an idea, I'd probably recommend tryi...
- Fri Mar 04, 2022 7:47 am
- Forum: Raspberry Pi microcontroller boards
- Topic: How to organize code
- Replies: 5
- Views: 2065
Re: How to organize code
You probably should have a look at other small Python projects, and micropython's own python code to see how things are structured. Modules are for grouping functionality i.e. functions and classes, something like 'import my_variables' and 'import my_arrays' is the opposite and looks like a red herr...
- Mon Feb 28, 2022 8:38 am
- Forum: General Discussion and Questions
- Topic: Slow returning scalar types in async function
- Replies: 7
- Views: 2195
- Sun Feb 27, 2022 8:27 am
- Forum: General Discussion and Questions
- Topic: Slow returning scalar types in async function
- Replies: 7
- Views: 2195
Re: Slow returning scalar types in async function
Something is very wrong here. Windows port for test3 (and 10 iterations of that just to make sure): dict 15.809 int 3406.55 float 22.054 Seems worth creating a Github issue for this: while it's not suprirising creating a generator has an overhead, the differences observed here are so large it's eith...
- Sat Feb 26, 2022 8:19 am
- Forum: General Discussion and Questions
- Topic: ImportError: no module named 'logging'
- Replies: 3
- Views: 3333
Re: ImportError: no module named 'logging'
None of micropython-lib is included in firmware by default actually, not for any port.
- Thu Feb 17, 2022 7:04 am
- Forum: Raspberry Pi microcontroller boards
- Topic: Micropython String
- Replies: 4
- Views: 2131
Re: Micropython String
Perhaps you were looking at CPython examples?
MicroPython indeed does not implement those functions: http://docs.micropython.org/en/latest/g ... s.html#str
MicroPython indeed does not implement those functions: http://docs.micropython.org/en/latest/g ... s.html#str
- Mon Feb 07, 2022 7:45 pm
- Forum: Development of MicroPython
- Topic: vstr_t line avoiding a sweep from GC in pyexec
- Replies: 1
- Views: 3223
Re: vstr_t line avoiding a sweep from GC in pyexec
Didn't check in detail, but the non-eventdriven version is one big loop hence line is on the stack as long as the program runs and as such doesn't get garbage collected because the mark phase will see it being on the stack?