matsstaff / stc1000p

Programmable thermostat firmware and arduino based uploader for the STC-1000 thermostat
GNU General Public License v3.0
261 stars 47 forks source link

optimized ADC range checking code and probe2 check. saves 142 bytes. #75

Closed seanmcveigh closed 8 years ago

seanmcveigh commented 8 years ago

also started adding some optimization tips to the README

seanmcveigh commented 8 years ago

here's a 1st pull request.. I only made one major change, and that is to how ad_filter is range-checked. since the state of probe2 is needed in the range-checking code, I moved it's availability to a global flag so it can be accessed by read_ad() without reading the eeprom. Optimized out a second call to check the same eeprom value in temperature_control() as well.

I have not tested any of these changes yet, as I have not yet rigged up a programmer, so if you would kindly see if it still works, that would be great! I plan to get a programmer together in the next couple of days.

seanmcveigh commented 8 years ago

for clarity, I did not commit any of the prebuilt hex files or anything. let me know how you'd like to move forward in that respect :)