Skip to content

Commit

Permalink
Bugfix for ATmega 328/168
Browse files Browse the repository at this point in the history
Tested with Arduino Nano (ATmega 328)
  • Loading branch information
maxint-rd authored Dec 25, 2017
1 parent 914059d commit 52da86e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion MmlMusicPWM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ ISR(TIMER2_COMPA_vect)
{ // Timer interrupt vector.
if(!__thisMmlMusicPWM__)
return;
if (millis() > _tTim2_time)
if (millis() > __thisMmlMusicPWM__->_tTim2_time)
{
__thisMmlMusicPWM__->_noToneTim2(); // Check to see if it's time for the note to end.
__thisMmlMusicPWM__->_executeCommandTim2(); // execute the next command
Expand Down
2 changes: 1 addition & 1 deletion MmlMusicPWM.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class MmlMusicPWM : public MmlMusic {
volatile uint8_t *_pinMode; // Pin mode.
uint8_t _pinMask = 0; // Bitmask for pins
volatile uint8_t *_pinOutput; // Output port register for pin.
const int _tTim2_prescale[] = { 2, 16, 64, 128, 256, 512, 2048 }; // Prescaler.
const int _tTim2_prescale[7] = { 2, 16, 64, 128, 256, 512, 2048 }; // Prescaler.
#endif

private:
Expand Down

0 comments on commit 52da86e

Please sign in to comment.