Is there a function to load the saved program *without* running onInit()? #333
Replies: 6 comments
-
Posted at 2014-12-03 by Manxome I am probably too ignorant to suggest anything...but I'm willing to look silly if it helps me learn :) Could you put some code at the top of onInit() which does an early exit if a button is held down? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-12-04 by DrAzzy Mmm, that would work, just if(digitalRead(pin)){return;} or something. Only takes 2.5 memory units. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-12-04 by Manxome @drazzy, how can you tell how much memory is used? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-12-04 by DrAzzy In terms of stored code size, which is what I was referring to (since that's usually what you're up against) - you get ~12 bytes per jsvar. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-12-04 by Manxome is that from trace()? I looked at that but really didn't see anything like "2.5 memory units". |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-12-04 by @gfwilliams The easiest way to check memory is to run As far as not running onInit - I'd afraid there is nothing built-in, so as Manxome says you'd have to put something at the start of it. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2014-12-03 by DrAzzy
We have reset() to reset without loading or running onInit(), but there doesn't seem to be a way to load the stored code without running onInit(). Load() states that it runs onInit(), and reset doesn't load anything.
Am I missing something simple? It would be useful to be able to get back to the clean, pre-onInit code, so that you could edit a function and save() it again - without having to have the clean code available to re-send (for example, if programming over something other than the IDE. Particularly relevant due to the memory constraints, where functions used to initialize things are deleted after they run to free the memory up.
Beta Was this translation helpful? Give feedback.
All reactions