Fixed an oopsie, removed a vestigial flag, and added some comments.

This commit is contained in:
David Lenfesty 2019-10-22 10:43:08 -06:00
parent 97184999fd
commit fc74d91557

View File

@ -7,8 +7,6 @@
#include "main.h" #include "main.h"
bool play_flag = 0;
/* /*
* Pin Definitions: * Pin Definitions:
* PB2 -> OC0A output * PB2 -> OC0A output
@ -104,19 +102,14 @@ bool play_beat() {
int main(void) int main(void)
{ {
// Run initialisation functionality
gpio_init(); gpio_init();
timer_init(); timer_init();
beat_t beat = {
.note = a,
.duration = 20,
.octave = 0,
};
play_note(beat, 1);
while (1) while (1)
{ {
// Wait for button press
if (bit_is_clear(PIND, PIND2)) { if (bit_is_clear(PIND, PIND2)) {
// Play song until the end // Play song until the end
while(play_beat()); while(play_beat());