wizard97 / ArduinoProcessScheduler

An Arduino object oriented process scheduler designed to replace them all
46 stars 16 forks source link

Process exiting #8

Open MarcFinns opened 7 years ago

MarcFinns commented 7 years ago

Hello, Is it possible for a process that has completed its intended course of actions to disable and remove itself somehow, or do I need to implement yet another killer / garbage collector process? thanks!

wizard97 commented 7 years ago

Hi, It is completely valid and safe to have a process call any of the: disable() enable() destroy() restart()

Routines from inside a service routine. In your case destroy() will be the appropriate one to remove itself completely

MarcFinns commented 7 years ago

Great! shall I assume that the objet itself will be gone / its memory released? thanks again!

wizard97 commented 7 years ago

It is never recommend to use dynamic memory when programming microcontrollers. If you have created your process object in global space (as you likely have) it will exist on the stack and destroy will not free the memory because it is not dynamic to begin with.

That being said it is possible and supported to use processes that use dynamic memory. Instead of statically allocating your processes, you will have to call new Process.To free itself when it exits, at the very last line of cleanup, you can call delete this. Again, dynamic memory usage is not recommend.

MarcFinns commented 7 years ago

I know you are right, but I need to free up memory at some point after certain tasks have been carried out

wizard97 commented 7 years ago

Cool, good luck. Also remember that disable(), enable, destroy(), etc... just sends a signal to the scheduler, and this call will not immediately call the associated routine.

MarcFinns commented 6 years ago

Hi Aaron, Just thought to share my project, made possible by your Process Scheduler… Thanks again. m

https://youtu.be/iyFuKU8ZcuA

From: Aaron Wisner notifications@github.com Reply-To: wizard97/ArduinoProcessScheduler reply@reply.github.com Date: Monday, 4 September 2017 at 19:23 To: wizard97/ArduinoProcessScheduler ArduinoProcessScheduler@noreply.github.com Cc: Marcello Fini marcello@fini.org, Author author@noreply.github.com Subject: Re: [wizard97/ArduinoProcessScheduler] Process exiting (#8)

Cool, good luck. Also remember that disable(), enable, destroy(), etc... just sends a signal to the scheduler, and this call will not immediately call the associated routine.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/wizard97/ArduinoProcessScheduler/issues/8#issuecomment-327005240, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AXPSLe-74lTmI6CQODYe1yARPeZkTjnVks5sfDH_gaJpZM4PMCfq.

wizard97 commented 6 years ago

Congrats on finally finishing your project! I had a chance to watch your video, it's very impressive what you managed to acomplish. This is definitely one of the more complicated projects I have seen that have used this library.

Any chance you would be willing to share your code?

MarcFinns commented 6 years ago

Hi there, thanks.

I kind of published it in the current state as I have no time to work on it anymore...

The code was started in a semi-proper way, with an OO application framework, but I run into memory issues and I had to take shortcuts.

I even had to make a custom memory mapping (2M code, 2M SPIFFS) to make it fit and retain the OTA capabilities.

I would need a proper IDE to comment / cleanup / refactor but.. no time!

If I see any interest and I find time I might do a sort of instructable.


From: Aaron Wisner notifications@github.com Sent: 22 January 2018 02:10 To: wizard97/ArduinoProcessScheduler Cc: marcello fini; Author Subject: Re: [wizard97/ArduinoProcessScheduler] Process exiting (#8)

Congrats on finally finishing your project! I had a chance to watch your video, it's very impressive what you managed to acomplish. This is definitely one of the more complicated projects I have seen that have used this library.

Any chance you would be willing to share your code?

- You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/wizard97/ArduinoProcessScheduler/issues/8#issuecomment-359299522, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AXPSLaTmZB8sDYW9eigLteNWTAHoQlPkks5tM-AbgaJpZM4PMCfq.

MarcFinns commented 6 years ago

Forgot..

https://github.com/MarcFinns/AtmoScan


From: Aaron Wisner notifications@github.com Sent: 22 January 2018 02:10 To: wizard97/ArduinoProcessScheduler Cc: marcello fini; Author Subject: Re: [wizard97/ArduinoProcessScheduler] Process exiting (#8)

Congrats on finally finishing your project! I had a chance to watch your video, it's very impressive what you managed to acomplish. This is definitely one of the more complicated projects I have seen that have used this library.

Any chance you would be willing to share your code?

- You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/wizard97/ArduinoProcessScheduler/issues/8#issuecomment-359299522, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AXPSLaTmZB8sDYW9eigLteNWTAHoQlPkks5tM-AbgaJpZM4PMCfq.

GitMoDu commented 6 years ago

@MarcFinns Try this plug-in for Visual Studio, it's free to use (1 pop-up a day) and integrates well enough to use VS functionalities (indentation, refactor, static analysis, etc..)

MarcFinns commented 6 years ago

Here it is! https://www.instructables.com/id/AtmoScan/

From: Aaron Wisner notifications@github.com Reply-To: wizard97/ArduinoProcessScheduler reply@reply.github.com Date: Monday, 22 January 2018 at 02:10 To: wizard97/ArduinoProcessScheduler ArduinoProcessScheduler@noreply.github.com Cc: Marcello Fini marcello@fini.org, Author author@noreply.github.com Subject: Re: [wizard97/ArduinoProcessScheduler] Process exiting (#8)

Congrats on finally finishing your project! I had a chance to watch your video, it's very impressive what you managed to acomplish. This is definitely one of the more complicated projects I have seen that have used this library.

Any chance you would be willing to share your code?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/wizard97/ArduinoProcessScheduler/issues/8#issuecomment-359299522, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AXPSLaTmZB8sDYW9eigLteNWTAHoQlPkks5tM-AbgaJpZM4PMCfq.

wizard97 commented 6 years ago

That is awesome, it looks like you are getting a lot of interest and comments in just a day after showing your project on hackaday. Very impressed what you managed to pull off on just an esp8266!

MarcFinns commented 6 years ago

It’s your scheduler...

Sent from my iPhone

On 9 Mar 2018, at 19:48, Aaron Wisner notifications@github.com<mailto:notifications@github.com> wrote:

That is awesome, it looks like you are getting a lot of interest and comments in just a day after showing your project on hackaday. Very impressed what you managed to pull off on just an esp8266!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/wizard97/ArduinoProcessScheduler/issues/8#issuecomment-371909581, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AXPSLTilQaJZjnb__mlgakpru-lVZGSgks5tcs5hgaJpZM4PMCfq.

wizard97 commented 6 years ago

Imagine what you could do with the ESP32!

MarcFinns commented 6 years ago

And some time…

From: Aaron Wisner notifications@github.com Reply-To: wizard97/ArduinoProcessScheduler reply@reply.github.com Date: Saturday, 10 March 2018 at 20:20 To: wizard97/ArduinoProcessScheduler ArduinoProcessScheduler@noreply.github.com Cc: Marcello Fini marcello@fini.org, Mention mention@noreply.github.com Subject: Re: [wizard97/ArduinoProcessScheduler] Process exiting (#8)

Imagine what you could do with the ESP32!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/wizard97/ArduinoProcessScheduler/issues/8#issuecomment-372057508, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AXPSLTH-M8uq_xXirhC3kjMyOx0Ab_8Iks5tdCdpgaJpZM4PMCfq.