What is the behavior of pyb.ExtInt(), which doesn't seem to use this option?
Search found 20 matches
- Thu Jul 28, 2022 6:55 pm
- Forum: MicroPython pyboard
- Topic: Why is the interrupt queued?
- Replies: 5
- Views: 30788
Re: Why is the interrupt queued?
- Fri Jun 10, 2022 6:43 pm
- Forum: General Discussion and Questions
- Topic: Fast/efficient alternative to bytearray.index()?
- Replies: 18
- Views: 9273
Re: Fast/efficient alternative to bytearray.index()?
Add the comment
Code: Select all
# type: ignore
- Tue Feb 08, 2022 11:07 pm
- Forum: Programs, Libraries and Tools
- Topic: VS Code Pymar microython
- Replies: 9
- Views: 44575
Re: VS Code Pymar microython
Language and lint checking can be disabled for individual lines by appending "type: ignore" as a comment. For example: import machine # type: ignore This will also cause any machine.[*] call to not trigger a warning. Checking for an entire file can be disable by putting the same as a line comment at...
- Fri Feb 04, 2022 3:33 pm
- Forum: MicroPython pyboard
- Topic: How to use CRC on STM32 Hardware
- Replies: 1
- Views: 4811
- Wed Nov 17, 2021 6:31 pm
- Forum: General Discussion and Questions
- Topic: Trying to understand f-strings...
- Replies: 5
- Views: 2726
Re: Trying to understand f-strings...
I think it is a similar issue as trying to use an object variable as a method parameter (default argument) within the same class, which is why I proposed the above.
- Wed Nov 10, 2021 8:58 pm
- Forum: General Discussion and Questions
- Topic: Trying to understand f-strings...
- Replies: 5
- Views: 2726
Re: Trying to understand f-strings...
Would this work for your needs?
Code: Select all
def foo(s=None):
v = 4.2
if s is None:
s = f"{v}"
print(s)
- Fri Aug 27, 2021 5:21 pm
- Forum: Pyboard D-series
- Topic: Can I specify the number of bytes to read into an over-sized buffer via SPI?
- Replies: 10
- Views: 25661
Re: Can I specify the number of bytes to read into an over-sized buffer via SPI?
That's a good idea. Thanks.
For this particular case, it would be sufficient if an optional integer could be passed to spi.readinto() to specify the number of bytes to read.
For this particular case, it would be sufficient if an optional integer could be passed to spi.readinto() to specify the number of bytes to read.
- Fri Aug 27, 2021 3:43 pm
- Forum: Pyboard D-series
- Topic: Can I specify the number of bytes to read into an over-sized buffer via SPI?
- Replies: 10
- Views: 25661
Re: Can I specify the number of bytes to read into an over-sized buffer via SPI?
Thanks much for creating the issue. Indeed, we're streaming data too frequently for micropython.schedule(). As a workaround, I was able to pre-allocate buffers for all the potential buffer sizes (it turns out there are only a handful, but that might go up in the future), and use the buffer that matc...
- Thu Aug 26, 2021 10:52 pm
- Forum: Pyboard D-series
- Topic: Can I specify the number of bytes to read into an over-sized buffer via SPI?
- Replies: 10
- Views: 25661
Re: Can I specify the number of bytes to read into an over-sized buffer via SPI?
The .readinto(mv[0:N]) generates a heap allocation exception. Here's how I set it up: In __init__(): self.header_buffer = bytearray(self._HEADER_BUFFER_SIZE) # (4 bytes) self.cargo_buffer = bytearray(self._CARGO_BUFFER_SIZE) self.cargo_memoryview = memoryview(self.cargo_buffer) self.number_of_bytes ...
- Wed Aug 25, 2021 9:07 pm
- Forum: Pyboard D-series
- Topic: Can I specify the number of bytes to read into an over-sized buffer via SPI?
- Replies: 10
- Views: 25661
Re: Can I specify the number of bytes to read into an over-sized buffer via SPI?
This is the kicker. I can't figure out how to read only the number of bytes specified in the header. The spi.readinto call will keep reading to fill the buffer (which results in filling out the unnecessary part at the end with zeros). By using the largest possible buffer, I'm always taking the time ...