Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memory cleanup #169

Merged
merged 9 commits into from
Aug 21, 2022
Merged

memory cleanup #169

merged 9 commits into from
Aug 21, 2022

Conversation

heythisisnate
Copy link
Contributor

No description provided.

@heythisisnate heythisisnate force-pushed the mem-cleanup branch 2 times, most recently from a42817e to f89a334 Compare August 19, 2022 19:58
heythisisnate and others added 4 commits August 19, 2022 17:13
This allows the Lua complier to execute the zoneToPin function directly from flash with no RAM used for the previous table.
* Allows for modules to access mqtt methods for situations where it may be required.
* When settings are pushed the mqtt client will now be disconnected before writing the new settings,
which is now handled in the "offline" method of the mqtt client. This allows for larger payloads by freeing
memory before processing, preventing "out of RAM" errors.
if zone == 5 or zone == '5' then return 7 end
if zone == 6 or zone == '6' then return 9 end
if zone == "out" then return 8 end
end
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😆

local request = require("httpd_req")(payload)
local response = require("httpd_res")()
request = require("httpd_req")(payload)
response = require("httpd_res")()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curious what does removing the local declaration actually do?

Copy link
Contributor

@h2zero h2zero Aug 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes the variables global so they can be accessed in the offline callback before being garbage collected.

@heythisisnate heythisisnate changed the title WIP/experimental - memory cleanup memory cleanup Aug 21, 2022
@heythisisnate heythisisnate merged commit e4b92c3 into master Aug 21, 2022
@heythisisnate heythisisnate deleted the mem-cleanup branch August 21, 2022 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants