Fixed an oopsie, removed a vestigial flag, and added some comments.
This commit is contained in:
parent
97184999fd
commit
fc74d91557
11
lab_2/main.c
11
lab_2/main.c
@ -7,8 +7,6 @@
|
||||
|
||||
#include "main.h"
|
||||
|
||||
bool play_flag = 0;
|
||||
|
||||
/*
|
||||
* Pin Definitions:
|
||||
* PB2 -> OC0A output
|
||||
@ -104,19 +102,14 @@ bool play_beat() {
|
||||
|
||||
int main(void)
|
||||
{
|
||||
// Run initialisation functionality
|
||||
gpio_init();
|
||||
timer_init();
|
||||
|
||||
beat_t beat = {
|
||||
.note = a,
|
||||
.duration = 20,
|
||||
.octave = 0,
|
||||
};
|
||||
play_note(beat, 1);
|
||||
|
||||
while (1)
|
||||
{
|
||||
|
||||
// Wait for button press
|
||||
if (bit_is_clear(PIND, PIND2)) {
|
||||
// Play song until the end
|
||||
while(play_beat());
|
||||
|
Loading…
Reference in New Issue
Block a user