Generate callgraph

This commit is contained in:
Michael Hayes
2011-08-27 01:46:08 +00:00
commit 513810e138
233 changed files with 22993 additions and 0 deletions
+57
View File
@@ -0,0 +1,57 @@
# File: Makefile
# Author: M. P. Hayes, UCECE
# Date: 12 Sep 2010
# Descr: Makefile for hello1
# Definitions.
CC = avr-gcc
CFLAGS = -mmcu=atmega32u2 -Os -Wall -Wstrict-prototypes -Wextra -g -I. -I../../utils -I../../fonts -I../../drivers -I../../drivers/avr
OBJCOPY = avr-objcopy
SIZE = avr-size
DEL = rm
# Default target.
all: hello1.out
# Compile: create object files from C source files.
hello1.o: hello1.c ../../drivers/avr/system.h ../../drivers/ledmat.h ../../utils/pacer.h simplefont.h
$(CC) -c $(CFLAGS) $< -o $@
pio.o: ../../drivers/avr/pio.c ../../drivers/avr/pio.h ../../drivers/avr/system.h
$(CC) -c $(CFLAGS) $< -o $@
system.o: ../../drivers/avr/system.c ../../drivers/avr/system.h
$(CC) -c $(CFLAGS) $< -o $@
timer.o: ../../drivers/avr/timer.c ../../drivers/avr/system.h ../../drivers/avr/timer.h
$(CC) -c $(CFLAGS) $< -o $@
ledmat.o: ../../drivers/ledmat.c ../../drivers/avr/pio.h ../../drivers/avr/system.h ../../drivers/ledmat.h
$(CC) -c $(CFLAGS) $< -o $@
pacer.o: ../../utils/pacer.c ../../drivers/avr/system.h ../../drivers/avr/timer.h ../../utils/pacer.h
$(CC) -c $(CFLAGS) $< -o $@
# Link: create ELF output file from object files.
hello1.out: hello1.o ledmat.o pacer.o pio.o system.o timer.o
$(CC) $(CFLAGS) $^ -o $@ -lm
$(SIZE) $@
# Target: clean project.
.PHONY: clean
clean:
-$(DEL) *.o *.out *.hex
# Target: program project.
.PHONY: program
program: hello1.out
$(OBJCOPY) -O ihex hello1.out hello1.hex
dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash hello1.hex; dfu-programmer atmega32u2 start
+51
View File
@@ -0,0 +1,51 @@
# File: Makefile
# Author: M. P. Hayes, UCECE
# Date: 11 Sep 2010
# Descr: Makefile for hello1
CC = gcc
CFLAGS = -Wall -Wstrict-prototypes -Wextra -g -I. -I../../utils -I../../drivers -I../../drivers/test
DEL = rm
# Default target.
all: hello1
# Compile: create object files from C source files.
timer-test.o: ../../drivers/test/timer.c ../../drivers/test/timer.h ../../drivers/test/system.h
$(CC) -c $(CFLAGS) $< -o $@
pio-test.o: ../../drivers/test/pio.c
$(CC) -c $(CFLAGS) $< -o $@
pacer-test.o: ../../utils/pacer.c ../../drivers/test/timer.h ../../utils/pacer.h ../../drivers/test/system.h
$(CC) -c $(CFLAGS) $< -o $@
ledmat-test.o: ../../drivers/ledmat.c ../../drivers/test/avrtest.h ../../drivers/test/pio.h ../../drivers/ledmat.h ../../drivers/test/system.h
$(CC) -c $(CFLAGS) $< -o $@
hello1-test.o: hello1.c ../../utils/pacer.h ../../drivers/ledmat.h simplefont.h ../../drivers/test/system.h
$(CC) -c $(CFLAGS) $< -o $@
system-test.o: ../../drivers/test/system.c ../../drivers/test/pio.h ../../drivers/test/avrtest.h ../../drivers/test/mgetkey.h ../../drivers/test/system.h
$(CC) -c $(CFLAGS) $< -o $@
mgetkey-test.o: ../../drivers/test/mgetkey.c ../../drivers/test/mgetkey.h
$(CC) -c $(CFLAGS) $< -o $@
# Link: create executable file from object files.
hello1: timer-test.o pio-test.o pacer-test.o ledmat-test.o hello1-test.o system-test.o mgetkey-test.o
$(CC) $(CFLAGS) $^ -o $@ -lrt
# Clean: delete derived files.
.PHONY: clean
clean:
-$(DEL) hello1 timer-test.o pio-test.o pacer-test.o ledmat-test.o hello1-test.o system-test.o mgetkey-test.o
+60
View File
@@ -0,0 +1,60 @@
/** @file hello1.c
@author M. P. Hayes, UCECE
@date 24 August 2009
@brief Simple message display program
@defgroup hello1 Simple message display program
*/
#include "system.h"
#include "simplefont.h"
#include "pacer.h"
#include "ledmat.h"
/* Define polling rate in Hz. */
#define LOOP_RATE 300
/* Define text update rate in Hz. */
#define MESSAGE_RATE 2
int main (void)
{
char message[] = "HELLO WORLD";
uint8_t col = 0;
uint8_t index = 0;
uint8_t tick = 0;
system_init ();
ledmat_init ();
pacer_init (LOOP_RATE);
/* Paced loop. */
while (1)
{
/* Wait for next tick. */
pacer_wait ();
ledmat_display_column (font[(message[index] - ' ') * 5 + col],
col);
col++;
if (col > 4)
col = 0;
/* Advance message. */
tick++;
if (tick >= LOOP_RATE / MESSAGE_RATE)
{
tick = 0;
index++;
if (!message[index])
index = 0;
}
}
return 0;
}
+79
View File
@@ -0,0 +1,79 @@
#ifndef SIMPLEFONT_H_
#define SIMPLEFONT_H_
#include <stdint.h>
static uint8_t font[] = {
/* */ 0x00, 0x00, 0x00, 0x00, 0x00,
/* ! */ 0x00, 0x00, 0x5F, 0x00, 0x00,
/* " */ 0x00, 0x03, 0x00, 0x03, 0x00,
/* # */ 0x12, 0x7F, 0x12, 0x7F, 0x12,
/* $ */ 0x26, 0x49, 0x7F, 0x49, 0x32,
/* % */ 0x43, 0x33, 0x08, 0x66, 0x61,
/* & */ 0x36, 0x49, 0x55, 0x23, 0x50,
/* ' */ 0x00, 0x00, 0x03, 0x00, 0x00,
/* ( */ 0x00, 0x1C, 0x63, 0x41, 0x00,
/* ) */ 0x00, 0x41, 0x63, 0x1C, 0x00,
/* * */ 0x49, 0x2A, 0x7F, 0x2A, 0x49,
/* + */ 0x08, 0x08, 0x7F, 0x08, 0x08,
/* , */ 0x00, 0x40, 0x70, 0x00, 0x00,
/* - */ 0x08, 0x08, 0x08, 0x08, 0x08,
/* . */ 0x00, 0x00, 0x40, 0x00, 0x00,
/* / */ 0x40, 0x30, 0x08, 0x06, 0x01,
/* 0 */ 0x3E, 0x51, 0x49, 0x45, 0x3E,
/* 1 */ 0x00, 0x42, 0x7F, 0x40, 0x00,
/* 2 */ 0x42, 0x61, 0x51, 0x49, 0x46,
/* 3 */ 0x21, 0x41, 0x45, 0x4B, 0x31,
/* 4 */ 0x18, 0x14, 0x12, 0x7F, 0x10,
/* 5 */ 0x27, 0x45, 0x45, 0x45, 0x39,
/* 6 */ 0x3C, 0x4A, 0x49, 0x49, 0x30,
/* 7 */ 0x01, 0x01, 0x79, 0x05, 0x03,
/* 8 */ 0x37, 0x49, 0x49, 0x49, 0x36,
/* 9 */ 0x06, 0x49, 0x49, 0x29, 0x1E,
/* : */ 0x00, 0x00, 0x14, 0x00, 0x00,
/* ; */ 0x00, 0x40, 0x74, 0x00, 0x00,
/* < */ 0x00, 0x08, 0x14, 0x22, 0x41,
/* = */ 0x14, 0x14, 0x14, 0x14, 0x14,
/* > */ 0x41, 0x22, 0x14, 0x08, 0x00,
/* ? */ 0x00, 0x06, 0x59, 0x05, 0x02,
/* @ */ 0x3E, 0x41, 0x4D, 0x51, 0x4E,
/* A */ 0x7E, 0x11, 0x11, 0x11, 0x7E,
/* B */ 0x41, 0x7F, 0x49, 0x49, 0x36,
/* C */ 0x3E, 0x41, 0x41, 0x41, 0x22,
/* D */ 0x41, 0x7F, 0x41, 0x41, 0x3E,
/* E */ 0x7F, 0x49, 0x49, 0x49, 0x49,
/* F */ 0x7F, 0x09, 0x09, 0x09, 0x01,
/* G */ 0x3E, 0x41, 0x41, 0x49, 0x7A,
/* H */ 0x7F, 0x08, 0x08, 0x08, 0x7F,
/* I */ 0x00, 0x41, 0x7F, 0x41, 0x00,
/* J */ 0x20, 0x40, 0x41, 0x3F, 0x01,
/* K */ 0x7F, 0x08, 0x14, 0x22, 0x41,
/* L */ 0x7F, 0x40, 0x40, 0x40, 0x40,
/* M */ 0x7F, 0x02, 0x0C, 0x02, 0x7F,
/* N */ 0x7F, 0x06, 0x08, 0x30, 0x7F,
/* O */ 0x3E, 0x41, 0x41, 0x41, 0x3E,
/* P */ 0x7F, 0x09, 0x09, 0x09, 0x06,
/* Q */ 0x7E, 0x41, 0x51, 0x21, 0x5E,
/* R */ 0x7F, 0x09, 0x19, 0x29, 0x46,
/* S */ 0x26, 0x49, 0x49, 0x49, 0x32,
/* T */ 0x01, 0x01, 0x7F, 0x01, 0x01,
/* U */ 0x3F, 0x40, 0x40, 0x40, 0x3F,
/* V */ 0x1F, 0x20, 0x40, 0x20, 0x1F,
/* W */ 0x7F, 0x20, 0x18, 0x20, 0x7F,
/* X */ 0x63, 0x14, 0x08, 0x14, 0x63,
/* Y */ 0x07, 0x08, 0x70, 0x08, 0x07,
/* Z */ 0x61, 0x51, 0x49, 0x45, 0x43,
/* [ */ 0x00, 0x7F, 0x41, 0x41, 0x00,
/* \ */ 0x01, 0x06, 0x08, 0x30, 0x40,
/* ] */ 0x00, 0x41, 0x41, 0x7F, 0x00,
/* ^ */ 0x00, 0x06, 0x01, 0x06, 0x00,
/* _ */ 0x40, 0x40, 0x40, 0x40, 0x40,
/* ` */ 0x00, 0x01, 0x02, 0x00, 0x00
};
#define FONT_WIDTH 5
#define FONT_ASCII_OFFSET ' '
#define FONT_TABLE_SIZE (sizeof(font)/FONT_WIDTH)
#endif