Search found 5 matches

by MyUsername
Thu Feb 09, 2017 12:01 pm
Forum: Programs, Libraries and Tools
Topic: ESP8266 socket read without allocating new objects.
Replies: 2
Views: 3192

Re: ESP8266 socket read without allocating new objects.

In one of the recent builds, the readinto() was added. Maybe that helps. About the socket callback: You can actually allocate memory in that callback. In the callback, you can do almost everything allowed in Python. if you look at my ftp server (https://github.com/robert-hh/ESP8266-FTP-Server) or s...
by MyUsername
Mon Feb 06, 2017 8:07 pm
Forum: Programs, Libraries and Tools
Topic: ESP8266 socket read without allocating new objects.
Replies: 2
Views: 3192

ESP8266 socket read without allocating new objects.

My aim is to read from socket without allocating new objects. There is no recv_into or readinto methods in esp sockets. Moreover I have found out that basic onrecv callback is also not implemented in ESP. However, I have found this topic http://forum.micropython.org/viewtopic.php?f=16&t=2854&p=17505...
by MyUsername
Mon Feb 06, 2017 8:05 pm
Forum: Programs, Libraries and Tools
Topic: How much data does SPI.readinto reads?
Replies: 2
Views: 3380

Re: How much data does SPI.readinto reads?

If you want to use a pre-allocated buffer and create variable length views into that buffer then you should use memoryview. See: http://forum.micropython.org/viewtopic.php?f=2&t=1784&p=10117&hilit=memoryview#p10117 And yes SPI uses the length 'buf' to determine how much to read. so if you do someth...
by MyUsername
Mon Jan 23, 2017 2:52 pm
Forum: Programs, Libraries and Tools
Topic: How much data does SPI.readinto reads?
Replies: 2
Views: 3380

How much data does SPI.readinto reads?

Official documentation says: SPI.readinto(buf, write=0x00) Read into the buffer specified by buf while continuously writing the single byte given by write. Returns None. Note: on WiPy this function returns the number of bytes read. I wonder how can I specify length of data to be read by SPI.readinto...
by MyUsername
Mon Jan 02, 2017 4:11 pm
Forum: Development of MicroPython
Topic: Build firmware with python drivers.
Replies: 4
Views: 5679

Build firmware with python drivers.

How can I attach drivers written in python to build? For instance, there is a driver for nrf24l01. I have tried to add it like any other c driver to Makefile but it can't help.