Documentation
This commit is contained in:
parent
755230e2e7
commit
b86aafb56e
|
|
@ -45,6 +45,12 @@
|
||||||
// If there are any change requirements in the future, the signal must be checked with an osciloscope again,
|
// 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!
|
// 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
|
///! Definition off finite automaton states
|
||||||
enum class States : uint8_t {
|
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
|
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){
|
switch(state){
|
||||||
case States::ZERO_START:
|
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!
|
pwm = soft_pwm_bed << 1;// expecting soft_pwm_bed to be 7bit!
|
||||||
if( pwm != 0 ){
|
if( pwm != 0 ){
|
||||||
state = States::ZERO; // do nothing, let it tick once again after the 30Hz period
|
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;
|
break;
|
||||||
case States::ONE: // state ONE - we'll either stay in ONE or change to FALL
|
case States::ONE: // state ONE - we'll either stay in ONE or change to FALL
|
||||||
OCR0B = 255;
|
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
|
slowCounter += slowInc; // this does software timer_clk/256 or less
|
||||||
if( slowCounter < pwm ){
|
if( slowCounter < pwm ){
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue