-
• #2
Thr 2020.04.02
Hi @benoit, although I am unable to provide a definitive answer, I am responding as the ones that most likely have that content have been busy in BangleLand, and most likely will respond by tomorrow. In the mean time, a couple of things really stick out.
As you mentioned 'custom' board, had you seen this comment yet?
'Note: This is an online service that is only provided for official Espruino boards.'
http://www.espruino.com/InlineCI noticed that you have an official board from your other thread posts. Have you tried snippets of your custom code, to prove out whether the pin toggling may be done on a board we know is compiled for?
Also, had all the items beneath the heading 'Caveats' been read and understood. While 'inlineC' is incredibly fast, in my simple tests, found and understood the caveats mentioned there.
One item that might provide some insight is listed under:
Link under Examples:
http://www.espruino.com/Reference#l_E_getAddressOf
nRF52 Low Level Interface Library
-
• #3
You could actually get a big improvement with
turnDigitOn = digitalWrite.bind(null,[D6, D5, D4, D3, D2])
But there's no access to underlying APIs, so if you want access to the IO, you need to access the address of the register directly :)
-
• #4
I was wondering if I could write it in inlineC
yes
to speed up the thing.
Not sure your example would benefit from it. you can configure pins for output once and not each time and then you just set five of them, that doesn't look like expensive operation, see also https://www.espruino.com/Performance if speed is important.
Anyway fastest way to do this is to write OUT,OUTSET or OUTCLR GPIO register directly from javascript via poke32 command. So you can prepare the value and write all pins via single write (OUT) or two writes (OUTCLR,OUTSET). See the help here
So e.g. to clear pins 23456 via single write you'd write value 4+8+16+32+64 to OUTCLR via
poke32(124,0x50000000+0x50c)
or to set them to 1 you'd write same value to0x50000508
. When writing OUT register you'd need to take care of pins you don't want to change by reading the value before.
Hi !
I use a 7-segment led display like this one on a custom board with a NRF52832 (it runs espruino v2.01).
I have a setInterval that triggers a refreshDisplay function. This function calls three time the function turnDigitOn to display the hour.
As the refreshDisplay is called with an interval of 2ms, I was wondering if I could write it in inlineC to speed up the thing. I tried the following:
but when I then I have the following error message.
So is there a way to use these nrf functions (nrf_gpio_cfg_output and nrf_gpio_pin_write) and most importantly, will inlineC really increase performances?
Thanks and best regards.