diff --git a/final_project/comms/comms.c b/final_project/comms/comms.c index 2a66e56..e69de29 100644 --- a/final_project/comms/comms.c +++ b/final_project/comms/comms.c @@ -1,35 +0,0 @@ -#include "comms.h" - -inline void comms_send_command(comms_cmd_t cmd) { - while (! (UCSRA & (1 << UDRE))); - UDR = cmd; -} - -inline void comms_add_file(uint8_t id, char* filename) { - uint8_t len = strlen(filename); - - comms_send_command(COMMS_CMD_ADD_FILE); - comms_send_command((comms_cmd_t) id); - - uint8_t i = 0; - while (i < len) { - comms_send_command((comms_cmd_t) filename[i]); - } -} - -inline void comms_select_file(uint8_t id) { - comms_send_command(COMMS_CMD_SELECT_FILE); - comms_send_command((comms_cmd_t) id); -} - -inline void comms_clear() { - comms_send_command(COMMS_CMD_CLR); -} - -inline void comms_play() { - comms_send_command(COMMS_CMD_PLAY); -} - -inline void comms_pause() { - comms_send_command(COMMS_CMD_PLAY); -} \ No newline at end of file diff --git a/final_project/comms/comms.h b/final_project/comms/comms.h index ad660f5..f157160 100644 --- a/final_project/comms/comms.h +++ b/final_project/comms/comms.h @@ -21,26 +21,51 @@ typedef enum { /** @brief Inline function to send commands and values. */ -inline void comms_send_command(comms_cmd_t cmd); +inline void comms_send_command(comms_cmd_t cmd) { + while (! (UCSRA & (1 << UDRE))); + UDR = cmd; +} /** @brief Adds a file to the list on the LCD side. */ -inline void comms_add_file(uint8_t id, char* filename); +inline void comms_add_file(uint8_t id, char* filename) { + uint8_t len = strlen(filename); + + comms_send_command(COMMS_CMD_ADD_FILE); + comms_send_command((comms_cmd_t) id); + + uint8_t i = 0; + while (i < len) { + comms_send_command((comms_cmd_t) filename[i]); + } +} /** @brief Selects a file from the list on the DAC side. + * + * If another song is playing, this will stop + * that song from playing and select the new one. */ -inline void comms_select_file(uint8_t id); +inline void comms_select_file(uint8_t id) { + comms_send_command(COMMS_CMD_SELECT_FILE); + comms_send_command((comms_cmd_t) id); +} /** @brief Clears the LCD list of files. */ -inline void comms_clear(); +inline void comms_clear() { + comms_send_command(COMMS_CMD_CLR); +} /** @brief Starts playing song. */ -inline void comms_play(); +inline void comms_play() { + comms_send_command(COMMS_CMD_PLAY); +} /** @brief Pauses playing song. */ -inline void comms_pause(); +inline void comms_pause() { + comms_send_command(COMMS_CMD_PLAY); +} #endif \ No newline at end of file diff --git a/final_project/lcd_disp/.vscode/c_cpp_properties.json b/final_project/lcd_disp/.vscode/c_cpp_properties.json index 6fafcf7..4ad14cb 100644 --- a/final_project/lcd_disp/.vscode/c_cpp_properties.json +++ b/final_project/lcd_disp/.vscode/c_cpp_properties.json @@ -10,7 +10,8 @@ "-Wall", "-pedantic", "-mmcu=attiy2313a" ], "defines": [ - "F_CPU=16000000" + "F_CPU=16000000", + "__" ] } ], diff --git a/final_project/lcd_disp/.vscode/settings.json b/final_project/lcd_disp/.vscode/settings.json new file mode 100644 index 0000000..02b62d2 --- /dev/null +++ b/final_project/lcd_disp/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "C_Cpp.intelliSenseEngine": "Tag Parser" +} \ No newline at end of file diff --git a/final_project/lcd_disp/comms.c b/final_project/lcd_disp/comms.c deleted file mode 120000 index 14d83ba..0000000 --- a/final_project/lcd_disp/comms.c +++ /dev/null @@ -1 +0,0 @@ -../comms/comms.c \ No newline at end of file diff --git a/final_project/lcd_disp/main.c b/final_project/lcd_disp/main.c index 18f1796..767f520 100644 --- a/final_project/lcd_disp/main.c +++ b/final_project/lcd_disp/main.c @@ -3,16 +3,19 @@ /* ---- Global Flags ---- */ int16_t display_song = -1; //! ID of the song currently being displayed, -1 if song list is not initialised int16_t selected_song = -1; //! ID of the selected song. -1 if no song is selected. +bool update_display = false; //! flag on whether or not to update display struct { - char* names[MAX_SONGS]; - uint8_t num_songs; + char* names[MAX_SONGS]; //! array of all song names, names are allocated on heap + uint8_t num_songs; //! Number of songs loaded into display memory + bool playing; //! Whether the currently selected song is playing } songs; /** @brief Adds song to list of songs * * Allocates a new piece of memory for the name. */ +/* void add_song(char* name) { // Error out on too many songs if (songs.num_songs == MAX_SONGS) { @@ -26,11 +29,13 @@ void add_song(char* name) { songs.names[songs.num_songs] = malloc(name_len); songs.num_songs++; } +*/ /** @brief Clears list of songs * * Frees all memory used for name storage */ +/* void clear_songs() { // Free all memory for (uint8_t i = 0; i < songs.num_songs; i++) { @@ -39,59 +44,64 @@ void clear_songs() { songs.num_songs = 0; } +*/ -/** @brief Handles incoming Serial commands from the main player. - */ -ISR(USART_RX_vect) { - cli(); - // Push incoming data to FIFO - fifo_push(UDR); - sei(); -} - -/** @brief Sets up various GPIO functions - */ -void gpio_init() { - // Initialise button pins as inputs - BUTTONS_DDR &= ~(1 << BUTTONS_LEFT_PIN) & - ~(1 << BUTTONS_RIGHT_PIN) & - ~(1 << BUTTONS_PLAYPAUSE_PIN); - // Turn on button pullups - BUTTONS_PORT |= (1 << BUTTONS_LEFT_PIN) | - (1 << BUTTONS_RIGHT_PIN) | - (1 << BUTTONS_PLAYPAUSE_PIN); -} - -/** @brief Sets up USART for TX and RX with a baud rate of USART_BAUDRATE - */ -void usart_init() { - // initialize USART - UBRRL = UBRR_VALUE & 255; - UBRRH = UBRR_VALUE >> 8; - UCSRB = (1 << TXEN) | (1 << RXEN); // fire-up USART - UCSRC = (1 << UCSZ1) | (1 << UCSZ0); // fire-up USART - - - // Enable RX complete interrupt - UCSRB |= (1 << RXCIE); -} void handle_left_press() { - - + if (songs.num_songs == 0) { + lcd_clrscr(); + lcd_puts("No songs to play!"); + } else { + // Choose lower ID song. Wrap around. + display_song--; + if (display_song == 0) { + display_song = songs.num_songs - 1; + } + } } void handle_right_press() { - + if (songs.num_songs == 0) { + lcd_clrscr(); + lcd_puts("No songs to play!"); + } else { + // Choose higher ID song. Wrap around. + display_song++; + if (display_song == songs.num_songs) { + display_song = 0; + } + } } -// TODO NOT DONE +/** @brief Handles playpause button press. + * + * Based on selected song and displayed song, will select new song + * or play/pause song. + */ void handle_playpause_press() { + // If there are no songs displayed, error + if (display_song == -1) { + lcd_clrscr(); + lcd_puts("No songs to play!"); + return; + } + // If no song selected, select the correct one. if (selected_song == -1) { comms_select_file(display_song); + return; } + // Song selected, send play/pause + if (songs.playing) { + comms_pause(); + songs.playing = false; + } else { + comms_play(); + songs.playing = true; + } + + return; } int main() { @@ -102,6 +112,7 @@ int main() { gpio_init(); usart_init(); + lcd_init(LCD_DISP_ON); lcd_clrscr(); lcd_gotoxy(0,0); @@ -130,6 +141,19 @@ int main() { _delay_ms(100); // Delay to debounce } + // Update display periodically + if (update_display) { + lcd_clrscr(); + lcd_gotoxy(0,0); + lcd_puts(songs.names[display_song]); + lcd_gotoxy(0, 1); + //char tmp_string[17]; + //sprintf(tmp_string, "%1d %2d/%2d", + // display_song, display_song, songs.num_songs); + //lcd_puts(tmp_string); + + update_display = false; + } } } \ No newline at end of file diff --git a/final_project/lcd_disp/main.h b/final_project/lcd_disp/main.h index a318026..5f4e3aa 100644 --- a/final_project/lcd_disp/main.h +++ b/final_project/lcd_disp/main.h @@ -5,22 +5,19 @@ #include #include #include +#include #include +#include #include "lcd.h" #include "fifo.h" #include "comms.h" - -#define USART_BAUDRATE 9600 //! USART baudrate, change this to set it. -#define UBRR_VALUE (((F_CPU/(USART_BAUDRATE*16UL)))-1) +#include "periph.h" #define MAX_SONGS 16 -#define BUTTONS_DDR DDRD -#define BUTTONS_PORT PORTD -#define BUTTONS_LEFT_PIN PORTD2 -#define BUTTONS_RIGHT_PIN PORTD3 -#define BUTTONS_PLAYPAUSE_PIN PORTD4 +/* ---- Globally available flags ---- */ +extern bool update_display; #endif \ No newline at end of file diff --git a/final_project/lcd_disp/periph.c b/final_project/lcd_disp/periph.c new file mode 100644 index 0000000..bb18795 --- /dev/null +++ b/final_project/lcd_disp/periph.c @@ -0,0 +1,69 @@ +#include "periph.h" + + +/** @brief Handles incoming Serial commands from the main player. + */ +ISR(USART_RX_vect) { + cli(); + // Push incoming data to FIFO + fifo_push(UDR); + + // Flag is cleared by reading data from UDR + sei(); +} + +/** @brief Display update timer + */ +ISR(TIMER0_COMPA_vect) { + cli(); + update_display = true; + + // Flag is cleared by calling the vector + sei(); +} + +void gpio_init() { + // Initialise button pins as inputs + BUTTONS_DDR &= ~(1 << BUTTONS_LEFT_PIN) & + ~(1 << BUTTONS_RIGHT_PIN) & + ~(1 << BUTTONS_PLAYPAUSE_PIN); + // Turn on button pullups + BUTTONS_PORT |= (1 << BUTTONS_LEFT_PIN) | + (1 << BUTTONS_RIGHT_PIN) | + (1 << BUTTONS_PLAYPAUSE_PIN); +} + +void timer_init() { + /** + * Need to verify the math here. + * But with a prescaler of 1024, f_cpu at 8MHz, an OCRA of 195 gives + * 20Hz refresh rate. + */ + + // COM0x can be set to defaults + // To set to CTC, WGM = 0b010 + TCCR0A = (1 << WGM01); + + // CS = 0b101 -> 1024 prescaler + // Everything else should be 0. + // TCCR0B = 0b00000101; <- can't use this because binary stuff is a GCC extension + TCCR0B = 5; + + // Set to ~20Hz + OCR0A = 195; + + // Enable interrupt + TIMSK = (1 << OCIE0A); +} + +void usart_init() { + // initialize USART + UBRRL = UBRR_VALUE & 255; + UBRRH = UBRR_VALUE >> 8; + UCSRB = (1 << TXEN) | (1 << RXEN); // fire-up USART + UCSRC = (1 << UCSZ1) | (1 << UCSZ0); // fire-up USART + + + // Enable RX complete interrupt + UCSRB |= (1 << RXCIE); +} \ No newline at end of file diff --git a/final_project/lcd_disp/periph.h b/final_project/lcd_disp/periph.h new file mode 100644 index 0000000..e1ac82a --- /dev/null +++ b/final_project/lcd_disp/periph.h @@ -0,0 +1,45 @@ +/** + * @mainpage + * Peripherals + * + * @brief Peripheral initialization functions and interrupt handling routines. + * + * + * Contains the ISRs to handle the USART RX interrupt and the display timer interrupt. + */ + + +#ifndef PERIPH_H_ +#define PERIPH_H_ + +#include "main.h" + + +#define USART_BAUDRATE 9600 //! USART baudrate, change this to set it. +#define UBRR_VALUE (((F_CPU/(USART_BAUDRATE*16UL)))-1) + +#define BUTTONS_DDR DDRD +#define BUTTONS_PORT PORTD +#define BUTTONS_LEFT_PIN PORTD2 +#define BUTTONS_RIGHT_PIN PORTD3 +#define BUTTONS_PLAYPAUSE_PIN PORTD4 + + +/** @brief Sets up various GPIO functions + * + * First enables buttons as inputs. + */ +void gpio_init(); + +/** @brief Initialises timer for updating display + * + * Sets up timer0 in + */ +void timer_init(); + +/** @brief Sets up USART for TX and RX with a baud rate of USART_BAUDRATE + */ +void usart_init(); + + +#endif \ No newline at end of file diff --git a/final_project/lcd_disp/sd-reader.map b/final_project/lcd_disp/sd-reader.map index e4fdaef..0b097a4 100644 --- a/final_project/lcd_disp/sd-reader.map +++ b/final_project/lcd_disp/sd-reader.map @@ -6,15 +6,11 @@ Archive member included to satisfy reference by file (symbol) main.o (__do_copy_data) /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_clear_bss.o) main.o (__do_clear_bss) -/usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr25/tiny-stack/libc.a(malloc.o) - main.o (malloc) Allocating common symbols Common symbol size file -__brkval 0x2 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr25/tiny-stack/libc.a(malloc.o) -songs 0x21 main.o -__flp 0x2 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr25/tiny-stack/libc.a(malloc.o) +songs 0x22 main.o Memory Configuration @@ -32,7 +28,7 @@ Linker script and memory map LOAD /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr25/tiny-stack/crtattiny2313a.o LOAD lcd.o -LOAD comms.o +LOAD periph.o LOAD main.o LOAD fifo.o START GROUP @@ -139,7 +135,7 @@ END GROUP .rela.plt *(.rela.plt) -.text 0x0000000000000000 0x65a +.text 0x0000000000000000 0x4d6 *(.vectors) .vectors 0x0000000000000000 0x2a /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr25/tiny-stack/crtattiny2313a.o 0x0000000000000000 __vectors @@ -204,7 +200,6 @@ END GROUP 0x000000000000005c __vector_6 0x000000000000005c __vector_3 0x000000000000005c __vector_11 - 0x000000000000005c __vector_13 0x000000000000005c __vector_17 0x000000000000005c __vector_19 0x000000000000005c __vector_5 @@ -229,76 +224,71 @@ END GROUP 0x0000000000000180 lcd_puts 0x0000000000000196 lcd_puts_p 0x00000000000001b2 lcd_init - .text 0x0000000000000216 0x0 comms.o - .text 0x0000000000000216 0xe4 main.o - 0x0000000000000216 add_song - 0x000000000000025e clear_songs - 0x0000000000000288 __vector_7 - 0x00000000000002d4 gpio_init - 0x00000000000002e2 usart_init - 0x00000000000002f4 handle_left_press - 0x00000000000002f6 handle_right_press - 0x00000000000002f8 handle_playpause_press - .text 0x00000000000002fa 0xb6 fifo.o - 0x00000000000002fa fifo_init - 0x000000000000030c fifo_pop - 0x0000000000000360 fifo_push - .text 0x00000000000003b0 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_exit.o) - .text 0x00000000000003b0 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_copy_data.o) - .text 0x00000000000003b0 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_clear_bss.o) - .text 0x00000000000003b0 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr25/tiny-stack/libc.a(malloc.o) - 0x00000000000003b0 . = ALIGN (0x2) + .text 0x0000000000000216 0xa0 periph.o + 0x0000000000000216 __vector_7 + 0x0000000000000262 __vector_13 + 0x0000000000000284 gpio_init + 0x0000000000000292 timer_init + 0x00000000000002a4 usart_init + .text 0x00000000000002b6 0xc8 main.o + 0x00000000000002b6 handle_left_press + 0x00000000000002ec handle_right_press + 0x0000000000000322 handle_playpause_press + .text 0x000000000000037e 0xb6 fifo.o + 0x000000000000037e fifo_init + 0x0000000000000390 fifo_pop + 0x00000000000003e4 fifo_push + .text 0x0000000000000434 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_exit.o) + .text 0x0000000000000434 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_copy_data.o) + .text 0x0000000000000434 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_clear_bss.o) + 0x0000000000000434 . = ALIGN (0x2) *(.text.*) - .text.startup 0x00000000000003b0 0x64 main.o - 0x00000000000003b0 main + .text.startup 0x0000000000000434 0x9e main.o + 0x0000000000000434 main .text.libgcc.mul - 0x0000000000000414 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_exit.o) + 0x00000000000004d2 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_exit.o) .text.libgcc.div - 0x0000000000000414 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_exit.o) - .text.libgcc 0x0000000000000414 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_exit.o) + 0x00000000000004d2 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_exit.o) + .text.libgcc 0x00000000000004d2 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_exit.o) .text.libgcc.prologue - 0x0000000000000414 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_exit.o) + 0x00000000000004d2 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_exit.o) .text.libgcc.builtins - 0x0000000000000414 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_exit.o) + 0x00000000000004d2 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_exit.o) .text.libgcc.fmul - 0x0000000000000414 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_exit.o) + 0x00000000000004d2 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_exit.o) .text.libgcc.fixed - 0x0000000000000414 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_exit.o) + 0x00000000000004d2 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_exit.o) .text.libgcc.mul - 0x0000000000000414 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_copy_data.o) + 0x00000000000004d2 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_copy_data.o) .text.libgcc.div - 0x0000000000000414 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_copy_data.o) - .text.libgcc 0x0000000000000414 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_copy_data.o) + 0x00000000000004d2 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_copy_data.o) + .text.libgcc 0x00000000000004d2 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_copy_data.o) .text.libgcc.prologue - 0x0000000000000414 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_copy_data.o) + 0x00000000000004d2 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_copy_data.o) .text.libgcc.builtins - 0x0000000000000414 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_copy_data.o) + 0x00000000000004d2 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_copy_data.o) .text.libgcc.fmul - 0x0000000000000414 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_copy_data.o) + 0x00000000000004d2 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_copy_data.o) .text.libgcc.fixed - 0x0000000000000414 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_copy_data.o) + 0x00000000000004d2 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_copy_data.o) .text.libgcc.mul - 0x0000000000000414 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_clear_bss.o) + 0x00000000000004d2 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_clear_bss.o) .text.libgcc.div - 0x0000000000000414 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_clear_bss.o) - .text.libgcc 0x0000000000000414 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_clear_bss.o) + 0x00000000000004d2 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_clear_bss.o) + .text.libgcc 0x00000000000004d2 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_clear_bss.o) .text.libgcc.prologue - 0x0000000000000414 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_clear_bss.o) + 0x00000000000004d2 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_clear_bss.o) .text.libgcc.builtins - 0x0000000000000414 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_clear_bss.o) + 0x00000000000004d2 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_clear_bss.o) .text.libgcc.fmul - 0x0000000000000414 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_clear_bss.o) + 0x00000000000004d2 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_clear_bss.o) .text.libgcc.fixed - 0x0000000000000414 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_clear_bss.o) - .text.avr-libc - 0x0000000000000414 0x242 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr25/tiny-stack/libc.a(malloc.o) - 0x0000000000000414 malloc - 0x0000000000000544 free - 0x0000000000000656 . = ALIGN (0x2) + 0x00000000000004d2 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_clear_bss.o) + 0x00000000000004d2 . = ALIGN (0x2) *(.fini9) - .fini9 0x0000000000000656 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_exit.o) - 0x0000000000000656 exit - 0x0000000000000656 _exit + .fini9 0x00000000000004d2 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_exit.o) + 0x00000000000004d2 exit + 0x00000000000004d2 _exit *(.fini9) *(.fini8) *(.fini8) @@ -317,16 +307,16 @@ END GROUP *(.fini1) *(.fini1) *(.fini0) - .fini0 0x0000000000000656 0x4 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_exit.o) + .fini0 0x00000000000004d2 0x4 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_exit.o) *(.fini0) - 0x000000000000065a _etext = . + 0x00000000000004d6 _etext = . -.data 0x0000000000800060 0x1a load address 0x000000000000065a +.data 0x0000000000800060 0x16 load address 0x00000000000004d6 0x0000000000800060 PROVIDE (__data_start, .) *(.data) .data 0x0000000000800060 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr25/tiny-stack/crtattiny2313a.o .data 0x0000000000800060 0x0 lcd.o - .data 0x0000000000800060 0x0 comms.o + .data 0x0000000000800060 0x0 periph.o .data 0x0000000000800060 0x4 main.o 0x0000000000800060 selected_song 0x0000000000800062 display_song @@ -334,49 +324,42 @@ END GROUP .data 0x0000000000800064 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_exit.o) .data 0x0000000000800064 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_copy_data.o) .data 0x0000000000800064 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_clear_bss.o) - .data 0x0000000000800064 0x6 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr25/tiny-stack/libc.a(malloc.o) - 0x0000000000800064 __malloc_heap_end - 0x0000000000800066 __malloc_heap_start - 0x0000000000800068 __malloc_margin *(.data*) *(.rodata) *(.rodata*) .rodata.str1.1 - 0x000000000080006a 0x10 main.o + 0x0000000000800064 0x12 main.o *(.gnu.linkonce.d*) - 0x000000000080007a . = ALIGN (0x2) - 0x000000000080007a _edata = . - 0x000000000080007a PROVIDE (__data_end, .) + 0x0000000000800076 . = ALIGN (0x2) + 0x0000000000800076 _edata = . + 0x0000000000800076 PROVIDE (__data_end, .) -.bss 0x000000000080007a 0x5d - 0x000000000080007a PROVIDE (__bss_start, .) +.bss 0x0000000000800076 0x5b + 0x0000000000800076 PROVIDE (__bss_start, .) *(.bss) - .bss 0x000000000080007a 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr25/tiny-stack/crtattiny2313a.o - .bss 0x000000000080007a 0x0 lcd.o - .bss 0x000000000080007a 0x0 comms.o - .bss 0x000000000080007a 0x0 main.o - .bss 0x000000000080007a 0x38 fifo.o - .bss 0x00000000008000b2 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_exit.o) - .bss 0x00000000008000b2 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_copy_data.o) - .bss 0x00000000008000b2 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_clear_bss.o) - .bss 0x00000000008000b2 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr25/tiny-stack/libc.a(malloc.o) + .bss 0x0000000000800076 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr25/tiny-stack/crtattiny2313a.o + .bss 0x0000000000800076 0x0 lcd.o + .bss 0x0000000000800076 0x0 periph.o + .bss 0x0000000000800076 0x1 main.o + 0x0000000000800076 update_display + .bss 0x0000000000800077 0x38 fifo.o + .bss 0x00000000008000af 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_exit.o) + .bss 0x00000000008000af 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_copy_data.o) + .bss 0x00000000008000af 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_clear_bss.o) *(.bss*) *(COMMON) - COMMON 0x00000000008000b2 0x21 main.o - 0x00000000008000b2 songs - COMMON 0x00000000008000d3 0x4 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr25/tiny-stack/libc.a(malloc.o) - 0x00000000008000d3 __brkval - 0x00000000008000d5 __flp - 0x00000000008000d7 PROVIDE (__bss_end, .) - 0x000000000000065a __data_load_start = LOADADDR (.data) - 0x0000000000000674 __data_load_end = (__data_load_start + SIZEOF (.data)) + COMMON 0x00000000008000af 0x22 main.o + 0x00000000008000af songs + 0x00000000008000d1 PROVIDE (__bss_end, .) + 0x00000000000004d6 __data_load_start = LOADADDR (.data) + 0x00000000000004ec __data_load_end = (__data_load_start + SIZEOF (.data)) -.noinit 0x00000000008000d7 0x0 +.noinit 0x00000000008000d1 0x0 [!provide] PROVIDE (__noinit_start, .) *(.noinit*) [!provide] PROVIDE (__noinit_end, .) - 0x00000000008000d7 _end = . - 0x00000000008000d7 PROVIDE (__heap_start, .) + 0x00000000008000d1 _end = . + [!provide] PROVIDE (__heap_start, .) .eeprom 0x0000000000810000 0x0 *(.eeprom*) @@ -397,19 +380,19 @@ END GROUP .user_signatures *(.user_signatures*) -.stab 0x0000000000000000 0x1efc +.stab 0x0000000000000000 0x2208 *(.stab) .stab 0x0000000000000000 0x1008 lcd.o - .stab 0x0000000000001008 0x30c comms.o - 0x4e0 (size before relaxing) - .stab 0x0000000000001314 0x78c main.o - 0x978 (size before relaxing) - .stab 0x0000000000001aa0 0x45c fifo.o + .stab 0x0000000000001008 0x648 periph.o + 0x81c (size before relaxing) + .stab 0x0000000000001650 0x75c main.o + 0xa38 (size before relaxing) + .stab 0x0000000000001dac 0x45c fifo.o 0x5f4 (size before relaxing) -.stabstr 0x0000000000000000 0x12b5 +.stabstr 0x0000000000000000 0x1486 *(.stabstr) - .stabstr 0x0000000000000000 0x12b5 lcd.o + .stabstr 0x0000000000000000 0x1486 lcd.o .stab.excl *(.stab.excl) @@ -427,10 +410,9 @@ END GROUP *(.comment) .comment 0x0000000000000000 0x11 lcd.o 0x12 (size before relaxing) - .comment 0x0000000000000011 0x12 comms.o + .comment 0x0000000000000011 0x12 periph.o .comment 0x0000000000000011 0x12 main.o .comment 0x0000000000000011 0x12 fifo.o - .comment 0x0000000000000011 0x12 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr25/tiny-stack/libc.a(malloc.o) .note.gnu.avr.deviceinfo 0x0000000000000000 0x40 diff --git a/final_project/lcd_disp/sd-reader.out b/final_project/lcd_disp/sd-reader.out index fd4f98c..52651fc 100755 Binary files a/final_project/lcd_disp/sd-reader.out and b/final_project/lcd_disp/sd-reader.out differ