Skip to content

Commit

Permalink
effects: use timer tick
Browse files Browse the repository at this point in the history
alvieboy committed Jul 27, 2011
1 parent d30c088 commit 456f576
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion zetris/zetris.pde
Original file line number Diff line number Diff line change
@@ -66,6 +66,8 @@ static bool currentpiecevalid=false;
/* Colors for current and next piece */
static color_type *currentcolor, *nextcolor;

static unsigned int timerTicks = 0;

const int OPERATION_CLEAR=0;
const int OPERATION_DRAW=1;

@@ -242,6 +244,7 @@ void _zpu_interrupt()
}
}
#endif
timerTicks++;

TMR0CTL &= ~(BIT(TCTLIF));
}
@@ -557,7 +560,10 @@ void waitTick()
sync();
usleep(100000);
#endif
delay(100);
timerTicks = 0;
while ( timerTicks < 5 ) {
audiofill();
}
}

void special_effects(int y)

0 comments on commit 456f576

Please sign in to comment.