Save on Send (to Flash) and the SX127x module #6407
Replies: 1 comment
-
Posted at 2021-02-19 by @gfwilliams I believe it's to do with execution speed. It turns out When you upload you get that delay automatically because of the upload, but executing from flash it's too quick. Just doing:
should do it - ideally there should be a callback function when initialisation is done Posted at 2021-02-19 by @gniezen Hmm, that makes sense but it didn't resolve it either. I tried increasing the timeout from 10 to 100ms, and putting the onIRQ setInterval inside the timeout function, but no luck so far. Posted at 2021-03-05 by @gniezen @gfwilliams I just spent three hours rewriting the SX127x module to use Promises, got it working, and when I wanted to create a PR I discovered that you already fixed it by adding the callback code 😂️ Callback code works fine 👍️ How does it usually take before the changes on Posted at 2021-03-05 by @allObjects ...pub to .../modules has to happen to get modules updated. Furthermore: the connect sets stuff in the SX127X... (writes to registers of XS127X) which has to rerun on every power cycle... This is in addition to the fact that that setting of stuff is done in an asynchronous matter... and that is the actual - compound - issue. @gniezen, for the SX127X init reason, it is a good practice to always have an onInit() construct in the code to ensure consistent behavior no matter what upload approach is used and power cycle. @gfwilliams, what's the reason to not do simple callback to follow the prevailing pattern of Posted at 2021-03-05 by @gniezen @allObjects Sorry if I wasn't clear. Gordon implemented a simple callback fix two weeks ago (see espruino/EspruinoDocs@8ca56d2#diff-71fd1b58c3b419a0205973a478fd66da5ff6b2c138a5e4a35cfbbb2e129c06b0 ) after our initial discussion earlier in this thread, but I only noticed it after I created my own fix using Promises when I was looking to contribute it back to the code base. I was just wondering when his fix would be published to .../modules. Posted at 2021-03-08 by @gfwilliams Sorry about that - updates to the website are manual as I like to check what's changed each time. Usually it should happen in a few days, but last week was a bit crazy and I didn't get around to it. I'll get it updated now |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2021-02-18 by @gniezen
Why does the following code work just fine on the Pixl.js when code is uploaded to RAM, but when I use "Save on Send (to Flash)", or save() it wrapped in an onInit() function, does it just print "Sending.." and then stop?
Beta Was this translation helpful? Give feedback.
All reactions