Actual status, compared to direct_io branch is: switched fast io off (return false in jshGetPinAddress)
If you switched off fast IO, I believe you could just switch back to the master branch and forget about direct_io? All the other speed improvements are already pushed into master.
IMO direct_io would be great if we could get it working though.
how do we call task relevant RTOS function ? We could use #ifdef ESP32 or #ifdef RTOS. I would prefer the 2nd one.
There's actually already jshInterruptOn() and jshInterruptOff() - would those do what's needed, or is that overkill?
But yes, feel free to add an RTOS define to the Makefile and use #ifdef RTOS - I guess something like #ifdef FREERTOS may already exist?
do we need jshIsPinValid(d->pins[n]) in jswrap_io_shiftOutCallback ? Isn't this already done in jswrap_io_shiftOut ?
Yes, it's still needed. The check is only done when setting pin state.
The idea is you might be able to call it with pins = [D0,undefined,undefined,undefined,undefined,D1] if maybe you only wanted to use certain bits from the data you were sending. We could remove that functionality and make jswrap_io_shiftOut error if a pin couldn't be found though? That might be more sensible.
If you wanted to make it faster you could change the test to: d->pins[n] != PIN_UNDEFINED though?
In terms of speeding up IO, could you move gpio_matrix_out from jshPinSetValue into jshPinSetState? I think that should give you a bit extra:
Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
Tips:
Create headers by underlining text with ==== or ----
To *italicise* text put one asterisk each side of the word
To **bold** text put two asterisks each side of the word
Embed images by entering: ![](https://www.google.co.uk/images/srpr/logo4w.png) That's the hard one: exclamation, square brackets and then the URL to the image in brackets.
* Create lists by starting lines with asterisks
1. Create numbered lists by starting lines with a number and a dot
> Quote text by starting lines with >
Mention another user by @username
For syntax highlighting, surround the code block with three backticks:
```
Your code goes here
```
Just like Github, a blank line must precede a code block.
If you upload more than 5 files we will display all attachments as thumbnails.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
That's great!
If you switched off fast IO, I believe you could just switch back to the
master
branch and forget aboutdirect_io
? All the other speed improvements are already pushed into master.IMO
direct_io
would be great if we could get it working though.There's actually already
jshInterruptOn()
andjshInterruptOff()
- would those do what's needed, or is that overkill?But yes, feel free to add an
RTOS
define to the Makefile and use#ifdef RTOS
- I guess something like#ifdef FREERTOS
may already exist?Yes, it's still needed. The check is only done when setting pin state.
The idea is you might be able to call it with
pins = [D0,undefined,undefined,undefined,undefined,D1]
if maybe you only wanted to use certain bits from the data you were sending. We could remove that functionality and makejswrap_io_shiftOut
error if a pin couldn't be found though? That might be more sensible.If you wanted to make it faster you could change the test to:
d->pins[n] != PIN_UNDEFINED
though?In terms of speeding up IO, could you move
gpio_matrix_out
fromjshPinSetValue
intojshPinSetState
? I think that should give you a bit extra:https://github.com/espruino/Espruino/blob/master/targets/esp32/jshardware.c#L324