Added sample heater display mode check in custom_pid function. #729
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
I added in a simple check for the display mode of the sample heater in the custom PID function.
If the sample heater is not in "current" mode, then the display mode will be changed to "current" mode.
Motivation and Context
The custom PID function assumes that the sample heater display mode is set to current mode but does not check.
This leads to situations where the sample heater is in power mode and the custom PID will attempt to set the sample heater to a very high number in Watts instead of % of max current. This usually causes the PID function to break because the power in W is over the maximum range of the heater output. This confuses people when the custom PID will seemingly not work when started.
Resolves #494.
How Has This Been Tested?
Simple function addition shouldn't cause issues.
Types of changes
Checklist: