Context
Now that make firmware (PR #246) enables building firmware with drivers frozen in ROM, the RAM management hacks in examples are no longer needed.
Problem
calibrate_temperature.py uses __import__() / sys.modules.pop() / gc.collect() to load and unload drivers one at a time to stay within RAM limits. With frozen drivers, all imports come from ROM and don't consume significant RAM.
Solution
Replace dynamic imports with standard from xxx import XXX imports. Remove gc.collect() and sys.modules.pop() workarounds.
Related
Context
Now that
make firmware(PR #246) enables building firmware with drivers frozen in ROM, the RAM management hacks in examples are no longer needed.Problem
calibrate_temperature.pyuses__import__()/sys.modules.pop()/gc.collect()to load and unload drivers one at a time to stay within RAM limits. With frozen drivers, all imports come from ROM and don't consume significant RAM.Solution
Replace dynamic imports with standard
from xxx import XXXimports. Removegc.collect()andsys.modules.pop()workarounds.Related