Search found 69 matches

by v923z
Mon Sep 02, 2019 5:31 pm
Forum: Development of MicroPython
Topic: C module programming reference
Replies: 19
Views: 752

Re: C module programming reference

Hi all,

I have tried to fix the issues that Bitrat pointed out in his first post. You can find the new version of the docs under https://micropython-usermod.readthedocs.io/en/latest/, or https://github.com/v923z/micropython-usermod/.
All code segments are left unchanged.

Zoltán
by v923z
Mon Sep 02, 2019 5:29 pm
Forum: Development of MicroPython
Topic: C module programming reference
Replies: 19
Views: 752

Re: C module programming reference

Finally, and this is probably worthy of a separate post ...and maybe not entirely a MicroPython question at all: In the development docs, at Adding a Module , there are some comments on memory layout: The second file you will need to add to is esp8266.ld, which is the map of memory used by the comp...
by v923z
Mon Sep 02, 2019 5:26 pm
Forum: Development of MicroPython
Topic: C module programming reference
Replies: 19
Views: 752

Re: C module programming reference

So, in summary ....it would be great to have a minimal example C user module in the master branch, that newbies could hack on and get up to speed. The real learning curve here is not how to write C code, but how to mesh new files into the make. That step could be trivial it the instructions were ac...
by v923z
Sun Sep 01, 2019 5:35 pm
Forum: Development of MicroPython
Topic: C module programming reference
Replies: 19
Views: 752

Re: C module programming reference

So, in summary ....it would be great to have a minimal example C user module in the master branch, that newbies could hack on and get up to speed. The real learning curve here is not how to write C code, but how to mesh new files into the make. That step could be trivial it the instructions were ac...
by v923z
Sun Sep 01, 2019 5:30 pm
Forum: Development of MicroPython
Topic: C module programming reference
Replies: 19
Views: 752

Re: C module programming reference

Wow, this looks really great, thanks!!! I'm working through your examples in full! ..fyi (not a criticism) your index.rst isn't rendering. Also, I'm not that familiar with IPython etc, and you've left a space for a link here: If you don’t know what ipython magics are, you can read more at … In any ...
by v923z
Sat Aug 31, 2019 5:10 pm
Forum: Development of MicroPython
Topic: C module programming reference
Replies: 19
Views: 752

C module programming reference

Hi all, In the past couple of weeks, I have been working on a micropython math module similar to numpy (sneak peek under https://github.com/v923z/micropython-ulab), and I realised that a programming manual is sorely missing. I have written up a thorough reference of what I needed for ulab, and what ...
by v923z
Sat Jun 29, 2019 9:21 am
Forum: Development of MicroPython
Topic: registering python special methods in C class
Replies: 2
Views: 271

Re: registering python special methods in C class

Hi Zoltán, If you still haven't figured out what is wrong, here is a hint: special methods have to be registered in your class definition, where you have the .name , the .make_new, .print methods, and the .locals_dict . In that very structure you should also have .unary_op for things like __len__ , ...
by v923z
Wed Jun 26, 2019 6:38 pm
Forum: Development of MicroPython
Topic: registering python special methods in C class
Replies: 2
Views: 271

registering python special methods in C class

Hi all, I am trying to implement a class in C, and would like to implement the special method __add__() . I was hoping that a+b would be evaluated, if a = testObj() b = testObj() However, I get the following traceback: Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError:...
by v923z
Thu Jan 17, 2019 7:12 pm
Forum: Programs, Libraries and Tools
Topic: fast font rendering on graphical displays
Replies: 9
Views: 969

Re: fast font rendering on graphical displays

To throw in some comments on my solution. The Writer class for monochrome displays uses bit blitting which is done in C. Unfortunately the framebuf blit method has no means of mapping a monochrome font onto a colour framebuf. This has been discussed but was never implemented. I agree, framebuf woul...
by v923z
Wed Jan 16, 2019 7:02 am
Forum: Programs, Libraries and Tools
Topic: fast font rendering on graphical displays
Replies: 9
Views: 969

Re: fast font rendering on graphical displays

Graphics requires the most amount of RAM out of about anything you r likely to do in Micro-Python. I could use an approach on ESP32 that I couldn't use on ESP8266 because of the fact ESP32 has more RAM than ESP8266 Updating 1 pixel at a time to the screen is super super slow. Being able to create a...