Documentation

This commit is contained in:
Alex Voinea 2020-01-29 23:03:20 +02:00
parent 755230e2e7
commit b86aafb56e
No known key found for this signature in database
GPG Key ID: F5034E7CFCF2F973
1 changed files with 8 additions and 2 deletions

View File

@ -45,6 +45,12 @@
// If there are any change requirements in the future, the signal must be checked with an osciloscope again,
// ad-hoc changes may completely screw things up!
// 2020-01-29 update: we are introducing a new option to the automaton that will allow us to force the output state
// to either full ON or OFF. This is so that interference during the MBL probing is minimal.
// To accomplish this goal we use bedPWMDisabled. It is only supposed to be used for brief periods of time as to
// not make the bed temperature too unstable. Also, careful consideration should be used when using this
// option as leaving this enabled will also keep the bed output in the state it stopped in.
///! Definition off finite automaton states
enum class States : uint8_t {
ZERO_START = 0,///< entry point of the automaton - reads the soft_pwm_bed value for the next whole PWM cycle
@ -95,7 +101,7 @@ ISR(TIMER0_OVF_vect) // timer compare interrupt service routine
{
switch(state){
case States::ZERO_START:
if (bedPWMDisabled) return;
if (bedPWMDisabled) return; // stay in the OFF state and do not change the output pin
pwm = soft_pwm_bed << 1;// expecting soft_pwm_bed to be 7bit!
if( pwm != 0 ){
state = States::ZERO; // do nothing, let it tick once again after the 30Hz period
@ -139,7 +145,7 @@ ISR(TIMER0_OVF_vect) // timer compare interrupt service routine
break;
case States::ONE: // state ONE - we'll either stay in ONE or change to FALL
OCR0B = 255;
if (bedPWMDisabled) return;
if (bedPWMDisabled) return; // stay in the ON state and do not change the output pin
slowCounter += slowInc; // this does software timer_clk/256 or less
if( slowCounter < pwm ){
return;