Changed static .data strings to PSTR(), removed oom situation

This commit is contained in:
IMback
2017-11-09 21:19:06 +01:00
parent 73f1bf57ae
commit 1cbff35a33
6 changed files with 79 additions and 90 deletions

View File

@ -139,16 +139,16 @@ void RgbLed::patternStep()
_pwmA->setDutyA(_counter >> 8);
_pwmB->setDutyB(_counter >> 3);
}
else if(_pattern == 4) //Sunrise
else if(_pattern == 4)
{
( _counter < 8192 ) ? _pwmA->setDutyB(_counter >> 6) : _pwmA->setDutyB( 128 + (_counter >> 11));
if( _counter > 8192 ) ( _counter < 16384 ) ? _pwmA->setDutyA((_counter-8192) >> 6) : _pwmA->setDutyA( 128 + (_counter >> 9 ));
if( _counter > 16384 ) _pwmB->setDutyB((_counter >> 14)*20);
( _counter < 8192 ) ? _pwmA->setDutyB(_counter >> 6) : _pwmA->setDutyB( 128 + (_counter >> 11));
if( _counter > 1024 ) ( 8192 < _counter && _counter < 16384 ) ? _pwmA->setDutyA((_counter-8192) >> 6) : _pwmA->setDutyA( 128 + (_counter >> 9 ));
if( _counter > 8192 ) _pwmB->setDutyB(_counter >> 9);
if( _counter < 65535 ) _counter++;
//else _pwmB->setDutyB(140);
if(_counter<65530) _counter++;
else _pwmB->setDutyB(140);
//_delay_ms(18); //honey dose this make me look slow?
_delay_ms(18); //honey dose this make me look slow?
}
}