malloc and free r bad

They will kill ur mother
This commit is contained in:
David Lenfesty 2019-11-28 13:33:46 -07:00
parent 958073b19b
commit 45e0794fe3
11 changed files with 304 additions and 194 deletions

View File

@ -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);
}

View File

@ -21,26 +21,51 @@ typedef enum {
/** @brief Inline function to send commands and values. /** @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. /** @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. /** @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. /** @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. /** @brief Starts playing song.
*/ */
inline void comms_play(); inline void comms_play() {
comms_send_command(COMMS_CMD_PLAY);
}
/** @brief Pauses playing song. /** @brief Pauses playing song.
*/ */
inline void comms_pause(); inline void comms_pause() {
comms_send_command(COMMS_CMD_PLAY);
}
#endif #endif

View File

@ -10,7 +10,8 @@
"-Wall", "-pedantic", "-mmcu=attiy2313a" "-Wall", "-pedantic", "-mmcu=attiy2313a"
], ],
"defines": [ "defines": [
"F_CPU=16000000" "F_CPU=16000000",
"__"
] ]
} }
], ],

View File

@ -0,0 +1,3 @@
{
"C_Cpp.intelliSenseEngine": "Tag Parser"
}

View File

@ -1 +0,0 @@
../comms/comms.c

View File

@ -3,16 +3,19 @@
/* ---- Global Flags ---- */ /* ---- Global Flags ---- */
int16_t display_song = -1; //! ID of the song currently being displayed, -1 if song list is not initialised 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. 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 { struct {
char* names[MAX_SONGS]; char* names[MAX_SONGS]; //! array of all song names, names are allocated on heap
uint8_t num_songs; uint8_t num_songs; //! Number of songs loaded into display memory
bool playing; //! Whether the currently selected song is playing
} songs; } songs;
/** @brief Adds song to list of songs /** @brief Adds song to list of songs
* *
* Allocates a new piece of memory for the name. * Allocates a new piece of memory for the name.
*/ */
/*
void add_song(char* name) { void add_song(char* name) {
// Error out on too many songs // Error out on too many songs
if (songs.num_songs == MAX_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.names[songs.num_songs] = malloc(name_len);
songs.num_songs++; songs.num_songs++;
} }
*/
/** @brief Clears list of songs /** @brief Clears list of songs
* *
* Frees all memory used for name storage * Frees all memory used for name storage
*/ */
/*
void clear_songs() { void clear_songs() {
// Free all memory // Free all memory
for (uint8_t i = 0; i < songs.num_songs; i++) { for (uint8_t i = 0; i < songs.num_songs; i++) {
@ -39,59 +44,64 @@ void clear_songs() {
songs.num_songs = 0; 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() { 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() { 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() { 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 no song selected, select the correct one.
if (selected_song == -1) { if (selected_song == -1) {
comms_select_file(display_song); 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() { int main() {
@ -102,6 +112,7 @@ int main() {
gpio_init(); gpio_init();
usart_init(); usart_init();
lcd_init(LCD_DISP_ON);
lcd_clrscr(); lcd_clrscr();
lcd_gotoxy(0,0); lcd_gotoxy(0,0);
@ -130,6 +141,19 @@ int main() {
_delay_ms(100); // Delay to debounce _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;
}
} }
} }

View File

@ -5,22 +5,19 @@
#include <avr/interrupt.h> #include <avr/interrupt.h>
#include <util/delay.h> #include <util/delay.h>
#include <string.h> #include <string.h>
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdbool.h>
#include "lcd.h" #include "lcd.h"
#include "fifo.h" #include "fifo.h"
#include "comms.h" #include "comms.h"
#include "periph.h"
#define USART_BAUDRATE 9600 //! USART baudrate, change this to set it.
#define UBRR_VALUE (((F_CPU/(USART_BAUDRATE*16UL)))-1)
#define MAX_SONGS 16 #define MAX_SONGS 16
#define BUTTONS_DDR DDRD /* ---- Globally available flags ---- */
#define BUTTONS_PORT PORTD extern bool update_display;
#define BUTTONS_LEFT_PIN PORTD2
#define BUTTONS_RIGHT_PIN PORTD3
#define BUTTONS_PLAYPAUSE_PIN PORTD4
#endif #endif

View File

@ -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);
}

View File

@ -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

View File

@ -6,15 +6,11 @@ Archive member included to satisfy reference by file (symbol)
main.o (__do_copy_data) main.o (__do_copy_data)
/usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_clear_bss.o) /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_clear_bss.o)
main.o (__do_clear_bss) 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 Allocating common symbols
Common symbol size file Common symbol size file
__brkval 0x2 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr25/tiny-stack/libc.a(malloc.o) songs 0x22 main.o
songs 0x21 main.o
__flp 0x2 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr25/tiny-stack/libc.a(malloc.o)
Memory Configuration 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 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr25/tiny-stack/crtattiny2313a.o
LOAD lcd.o LOAD lcd.o
LOAD comms.o LOAD periph.o
LOAD main.o LOAD main.o
LOAD fifo.o LOAD fifo.o
START GROUP START GROUP
@ -139,7 +135,7 @@ END GROUP
.rela.plt .rela.plt
*(.rela.plt) *(.rela.plt)
.text 0x0000000000000000 0x65a .text 0x0000000000000000 0x4d6
*(.vectors) *(.vectors)
.vectors 0x0000000000000000 0x2a /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr25/tiny-stack/crtattiny2313a.o .vectors 0x0000000000000000 0x2a /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr25/tiny-stack/crtattiny2313a.o
0x0000000000000000 __vectors 0x0000000000000000 __vectors
@ -204,7 +200,6 @@ END GROUP
0x000000000000005c __vector_6 0x000000000000005c __vector_6
0x000000000000005c __vector_3 0x000000000000005c __vector_3
0x000000000000005c __vector_11 0x000000000000005c __vector_11
0x000000000000005c __vector_13
0x000000000000005c __vector_17 0x000000000000005c __vector_17
0x000000000000005c __vector_19 0x000000000000005c __vector_19
0x000000000000005c __vector_5 0x000000000000005c __vector_5
@ -229,76 +224,71 @@ END GROUP
0x0000000000000180 lcd_puts 0x0000000000000180 lcd_puts
0x0000000000000196 lcd_puts_p 0x0000000000000196 lcd_puts_p
0x00000000000001b2 lcd_init 0x00000000000001b2 lcd_init
.text 0x0000000000000216 0x0 comms.o .text 0x0000000000000216 0xa0 periph.o
.text 0x0000000000000216 0xe4 main.o 0x0000000000000216 __vector_7
0x0000000000000216 add_song 0x0000000000000262 __vector_13
0x000000000000025e clear_songs 0x0000000000000284 gpio_init
0x0000000000000288 __vector_7 0x0000000000000292 timer_init
0x00000000000002d4 gpio_init 0x00000000000002a4 usart_init
0x00000000000002e2 usart_init .text 0x00000000000002b6 0xc8 main.o
0x00000000000002f4 handle_left_press 0x00000000000002b6 handle_left_press
0x00000000000002f6 handle_right_press 0x00000000000002ec handle_right_press
0x00000000000002f8 handle_playpause_press 0x0000000000000322 handle_playpause_press
.text 0x00000000000002fa 0xb6 fifo.o .text 0x000000000000037e 0xb6 fifo.o
0x00000000000002fa fifo_init 0x000000000000037e fifo_init
0x000000000000030c fifo_pop 0x0000000000000390 fifo_pop
0x0000000000000360 fifo_push 0x00000000000003e4 fifo_push
.text 0x00000000000003b0 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(_exit.o)
.text 0x00000000000003b0 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(_copy_data.o)
.text 0x00000000000003b0 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_clear_bss.o) .text 0x0000000000000434 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) 0x0000000000000434 . = ALIGN (0x2)
0x00000000000003b0 . = ALIGN (0x2)
*(.text.*) *(.text.*)
.text.startup 0x00000000000003b0 0x64 main.o .text.startup 0x0000000000000434 0x9e main.o
0x00000000000003b0 main 0x0000000000000434 main
.text.libgcc.mul .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 .text.libgcc.div
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 0x0000000000000414 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 .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 .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 .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 .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 .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 .text.libgcc.div
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 0x0000000000000414 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 .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 .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 .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 .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 .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 .text.libgcc.div
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 0x0000000000000414 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 .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 .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 .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 .text.libgcc.fixed
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.avr-libc 0x00000000000004d2 . = ALIGN (0x2)
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)
*(.fini9) *(.fini9)
.fini9 0x0000000000000656 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_exit.o) .fini9 0x00000000000004d2 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_exit.o)
0x0000000000000656 exit 0x00000000000004d2 exit
0x0000000000000656 _exit 0x00000000000004d2 _exit
*(.fini9) *(.fini9)
*(.fini8) *(.fini8)
*(.fini8) *(.fini8)
@ -317,16 +307,16 @@ END GROUP
*(.fini1) *(.fini1)
*(.fini1) *(.fini1)
*(.fini0) *(.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) *(.fini0)
0x000000000000065a _etext = . 0x00000000000004d6 _etext = .
.data 0x0000000000800060 0x1a load address 0x000000000000065a .data 0x0000000000800060 0x16 load address 0x00000000000004d6
0x0000000000800060 PROVIDE (__data_start, .) 0x0000000000800060 PROVIDE (__data_start, .)
*(.data) *(.data)
.data 0x0000000000800060 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr25/tiny-stack/crtattiny2313a.o .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 lcd.o
.data 0x0000000000800060 0x0 comms.o .data 0x0000000000800060 0x0 periph.o
.data 0x0000000000800060 0x4 main.o .data 0x0000000000800060 0x4 main.o
0x0000000000800060 selected_song 0x0000000000800060 selected_song
0x0000000000800062 display_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(_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(_copy_data.o)
.data 0x0000000000800064 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_clear_bss.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*) *(.data*)
*(.rodata) *(.rodata)
*(.rodata*) *(.rodata*)
.rodata.str1.1 .rodata.str1.1
0x000000000080006a 0x10 main.o 0x0000000000800064 0x12 main.o
*(.gnu.linkonce.d*) *(.gnu.linkonce.d*)
0x000000000080007a . = ALIGN (0x2) 0x0000000000800076 . = ALIGN (0x2)
0x000000000080007a _edata = . 0x0000000000800076 _edata = .
0x000000000080007a PROVIDE (__data_end, .) 0x0000000000800076 PROVIDE (__data_end, .)
.bss 0x000000000080007a 0x5d .bss 0x0000000000800076 0x5b
0x000000000080007a PROVIDE (__bss_start, .) 0x0000000000800076 PROVIDE (__bss_start, .)
*(.bss) *(.bss)
.bss 0x000000000080007a 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr25/tiny-stack/crtattiny2313a.o .bss 0x0000000000800076 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr25/tiny-stack/crtattiny2313a.o
.bss 0x000000000080007a 0x0 lcd.o .bss 0x0000000000800076 0x0 lcd.o
.bss 0x000000000080007a 0x0 comms.o .bss 0x0000000000800076 0x0 periph.o
.bss 0x000000000080007a 0x0 main.o .bss 0x0000000000800076 0x1 main.o
.bss 0x000000000080007a 0x38 fifo.o 0x0000000000800076 update_display
.bss 0x00000000008000b2 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_exit.o) .bss 0x0000000000800077 0x38 fifo.o
.bss 0x00000000008000b2 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(_exit.o)
.bss 0x00000000008000b2 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_clear_bss.o) .bss 0x00000000008000af 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/../../../avr/lib/avr25/tiny-stack/libc.a(malloc.o) .bss 0x00000000008000af 0x0 /usr/lib/gcc/avr/5.4.0/avr25/tiny-stack/libgcc.a(_clear_bss.o)
*(.bss*) *(.bss*)
*(COMMON) *(COMMON)
COMMON 0x00000000008000b2 0x21 main.o COMMON 0x00000000008000af 0x22 main.o
0x00000000008000b2 songs 0x00000000008000af songs
COMMON 0x00000000008000d3 0x4 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr25/tiny-stack/libc.a(malloc.o) 0x00000000008000d1 PROVIDE (__bss_end, .)
0x00000000008000d3 __brkval 0x00000000000004d6 __data_load_start = LOADADDR (.data)
0x00000000008000d5 __flp 0x00000000000004ec __data_load_end = (__data_load_start + SIZEOF (.data))
0x00000000008000d7 PROVIDE (__bss_end, .)
0x000000000000065a __data_load_start = LOADADDR (.data)
0x0000000000000674 __data_load_end = (__data_load_start + SIZEOF (.data))
.noinit 0x00000000008000d7 0x0 .noinit 0x00000000008000d1 0x0
[!provide] PROVIDE (__noinit_start, .) [!provide] PROVIDE (__noinit_start, .)
*(.noinit*) *(.noinit*)
[!provide] PROVIDE (__noinit_end, .) [!provide] PROVIDE (__noinit_end, .)
0x00000000008000d7 _end = . 0x00000000008000d1 _end = .
0x00000000008000d7 PROVIDE (__heap_start, .) [!provide] PROVIDE (__heap_start, .)
.eeprom 0x0000000000810000 0x0 .eeprom 0x0000000000810000 0x0
*(.eeprom*) *(.eeprom*)
@ -397,19 +380,19 @@ END GROUP
.user_signatures .user_signatures
*(.user_signatures*) *(.user_signatures*)
.stab 0x0000000000000000 0x1efc .stab 0x0000000000000000 0x2208
*(.stab) *(.stab)
.stab 0x0000000000000000 0x1008 lcd.o .stab 0x0000000000000000 0x1008 lcd.o
.stab 0x0000000000001008 0x30c comms.o .stab 0x0000000000001008 0x648 periph.o
0x4e0 (size before relaxing) 0x81c (size before relaxing)
.stab 0x0000000000001314 0x78c main.o .stab 0x0000000000001650 0x75c main.o
0x978 (size before relaxing) 0xa38 (size before relaxing)
.stab 0x0000000000001aa0 0x45c fifo.o .stab 0x0000000000001dac 0x45c fifo.o
0x5f4 (size before relaxing) 0x5f4 (size before relaxing)
.stabstr 0x0000000000000000 0x12b5 .stabstr 0x0000000000000000 0x1486
*(.stabstr) *(.stabstr)
.stabstr 0x0000000000000000 0x12b5 lcd.o .stabstr 0x0000000000000000 0x1486 lcd.o
.stab.excl .stab.excl
*(.stab.excl) *(.stab.excl)
@ -427,10 +410,9 @@ END GROUP
*(.comment) *(.comment)
.comment 0x0000000000000000 0x11 lcd.o .comment 0x0000000000000000 0x11 lcd.o
0x12 (size before relaxing) 0x12 (size before relaxing)
.comment 0x0000000000000011 0x12 comms.o .comment 0x0000000000000011 0x12 periph.o
.comment 0x0000000000000011 0x12 main.o .comment 0x0000000000000011 0x12 main.o
.comment 0x0000000000000011 0x12 fifo.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 .note.gnu.avr.deviceinfo
0x0000000000000000 0x40 0x0000000000000000 0x40

Binary file not shown.