diff --git a/B15F.aps b/B15F.aps
index 7cb06d5..1ea973b 100644
--- a/B15F.aps
+++ b/B15F.aps
@@ -1 +1 @@
-B15F22-Mar-2019 14:29:5422-Mar-2019 15:08:36241022-Mar-2019 14:29:5444, 19, 0, 730AVR GCCdefault\B15F.elfF:\JTAGICE mkIIATmega1284.xmlfalseR00R01R02R03R04R05R06R07R08R09R10R11R12R13R14R15R16R17R18R19R20R21R22R23R24R25R26R27R28R29R30R31Auto000main.cspi.cppspi.hdefault\B15F.lssdefault\B15F.mapc++NOatmega12811
B15F.elfc++\0-Wall -gdwarf-2 -Os -std=gnu99 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enumsdefaultNOatmega128411
B15F.elfdefault\0-Wall -gdwarf-2 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums default0C:\avr8-gnu-toolchain-win32_x86\bin\avr-g++.exeC:\WinAVR-20100110\utils\bin\make.exeF:\spi.hF:\main.cF:\spi.cpp00000main.c1
+B15F22-Mar-2019 14:29:5422-Mar-2019 15:51:33241022-Mar-2019 14:29:5444, 19, 0, 730AVR GCCF:\B15F.elfF:\JTAGICE mkIIATmega1284.xmlfalseR00R01R02R03R04R05R06R07R08R09R10R11R12R13R14R15R16R17R18R19R20R21R22R23R24R25R26R27R28R29R30R31Auto000spi.cppmain.cppMakefilespi.hdefault\B15F.lssdefault\B15F.mapc++NOatmega12811
B15F.elfc++\0-Wall -gdwarf-2 -Os -std=gnu99 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enumsdefaultYESMakefileatmega128411
B15F.elfdefault\1C:\avr8-gnu-toolchain-win32_x86\avr\include\C:\avr8-gnu-toolchain-win32_x86\avr\lib\libc.a-Wall -gdwarf-2 -DF_CPU=20000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enumsdefault0C:\avr8-gnu-toolchain-win32_x86\bin\avr-g++.exeC:\WinAVR-20100110\utils\bin\make.exeF:\spi.hF:\spi.cppF:\main.cppF:\Makefile00000spi.h100001main.cpp100002Makefile1
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..758290a
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,27 @@
+# Name: Makefile
+# Project: gcnc
+# Author: Tristan Krause
+# Creation Date: 2019-03-22
+
+OUTPUT = B15F.elf
+CFLAGS = -std=c++14 -mmcu=atmega1284 -DF_CPU=20000000
+LDFLAGS =
+OBJECTS = main.o
+
+COMPILER_PATH = C:\avr8-gnu-toolchain-win32_x86\bin\avr-g++.exe
+COMPILE = $(COMPILER_PATH) $(CFLAGS)
+
+B15F: $(OBJECTS)
+ @echo "Linking..."
+ $(COMPILE) $(OBJECTS) -o $(OUTPUT) $(LDFLAGS)
+
+help:
+ @echo "This Makefile has the following rules. Use one of the following:"
+ @echo "make B15F .... to compile (default)"
+ @echo "make clean ... to delete objects and hex file"
+
+clean:
+ rm -f $(OBJECTS) $(OUTPUT)
+
+.cpp.o:
+ $(COMPILE) -c $< -o $@
diff --git a/b15f.aws b/b15f.aws
index 98f2acd..b3835b3 100644
--- a/b15f.aws
+++ b/b15f.aws
@@ -1 +1 @@
-
+
diff --git a/default/B15F.elf b/default/B15F.elf
index 21b8968..08e891f 100644
Binary files a/default/B15F.elf and b/default/B15F.elf differ
diff --git a/default/B15F.lss b/default/B15F.lss
index 8623653..a564f37 100644
--- a/default/B15F.lss
+++ b/default/B15F.lss
@@ -13,17 +13,17 @@ Idx Name Size VMA LMA File off Algn
CONTENTS, READONLY
4 .debug_aranges 00000020 00000000 00000000 00000194 2**0
CONTENTS, READONLY, DEBUGGING
- 5 .debug_info 000007dc 00000000 00000000 000001b4 2**0
+ 5 .debug_info 00000833 00000000 00000000 000001b4 2**0
CONTENTS, READONLY, DEBUGGING
- 6 .debug_abbrev 00000762 00000000 00000000 00000990 2**0
+ 6 .debug_abbrev 0000079a 00000000 00000000 000009e7 2**0
CONTENTS, READONLY, DEBUGGING
- 7 .debug_line 00000055 00000000 00000000 000010f2 2**0
+ 7 .debug_line 00000061 00000000 00000000 00001181 2**0
CONTENTS, READONLY, DEBUGGING
- 8 .debug_frame 00000024 00000000 00000000 00001148 2**2
+ 8 .debug_frame 00000024 00000000 00000000 000011e4 2**2
CONTENTS, READONLY, DEBUGGING
- 9 .debug_str 0000037a 00000000 00000000 0000116c 2**0
+ 9 .debug_str 000003b8 00000000 00000000 00001208 2**0
CONTENTS, READONLY, DEBUGGING
- 10 .debug_ranges 00000010 00000000 00000000 000014e6 2**0
+ 10 .debug_ranges 00000010 00000000 00000000 000015c0 2**0
CONTENTS, READONLY, DEBUGGING
Disassembly of section .text:
@@ -80,8 +80,9 @@ Disassembly of section .text:
000000a4 :
-
int main() {
+
+ SPI spi_master;
return 0;
}
a4: 80 e0 ldi r24, 0x00 ; 0
diff --git a/default/B15F.map b/default/B15F.map
index 90e2dda..8dd5f98 100644
--- a/default/B15F.map
+++ b/default/B15F.map
@@ -23,6 +23,7 @@ LOAD main.o
LOAD spi.o
LOAD c:/avr8-gnu-toolchain-win32_x86/bin/../lib/gcc/avr/5.4.0/avr51\libgcc.a
LOAD c:/avr8-gnu-toolchain-win32_x86/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avr51\libm.a
+LOAD c:/avr8-gnu-toolchain-win32_x86/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avr51\libc.a
START GROUP
LOAD c:/avr8-gnu-toolchain-win32_x86/bin/../lib/gcc/avr/5.4.0/avr51\libgcc.a
LOAD c:/avr8-gnu-toolchain-win32_x86/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avr51\libm.a
@@ -371,31 +372,32 @@ END GROUP
.debug_pubnames
*(.debug_pubnames)
-.debug_info 0x00000000 0x7dc
+.debug_info 0x00000000 0x833
*(.debug_info .gnu.linkonce.wi.*)
.debug_info 0x00000000 0x792 c:/avr8-gnu-toolchain-win32_x86/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avr51/crtatmega1284.o
- .debug_info 0x00000792 0x4a main.o
+ .debug_info 0x00000792 0xa1 main.o
-.debug_abbrev 0x00000000 0x762
+.debug_abbrev 0x00000000 0x79a
*(.debug_abbrev)
.debug_abbrev 0x00000000 0x729 c:/avr8-gnu-toolchain-win32_x86/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avr51/crtatmega1284.o
- .debug_abbrev 0x00000729 0x39 main.o
+ .debug_abbrev 0x00000729 0x71 main.o
-.debug_line 0x00000000 0x55
+.debug_line 0x00000000 0x61
*(.debug_line .debug_line.* .debug_line_end)
.debug_line 0x00000000 0x1a c:/avr8-gnu-toolchain-win32_x86/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avr51/crtatmega1284.o
- .debug_line 0x0000001a 0x3b main.o
- .debug_line 0x00000055 0x0 spi.o
+ .debug_line 0x0000001a 0x47 main.o
+ .debug_line 0x00000061 0x0 spi.o
.debug_frame 0x00000000 0x24
*(.debug_frame)
.debug_frame 0x00000000 0x24 main.o
-.debug_str 0x00000000 0x37a
+.debug_str 0x00000000 0x3b8
*(.debug_str)
.debug_str 0x00000000 0x296 c:/avr8-gnu-toolchain-win32_x86/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avr51/crtatmega1284.o
- .debug_str 0x00000296 0xd9 main.o
- .debug_str 0x0000036f 0xb spi.o
+ .debug_str 0x00000296 0x117 main.o
+ 0x14b (size before relaxing)
+ .debug_str 0x000003ad 0xb spi.o
0xd5 (size before relaxing)
.debug_loc
diff --git a/default/Makefile b/default/Makefile
index 4aa90c1..9c8edd5 100644
--- a/default/Makefile
+++ b/default/Makefile
@@ -15,7 +15,7 @@ COMMON = -mmcu=$(MCU)
## Compile options common for all C compilation units.
CFLAGS = $(COMMON)
-CFLAGS += -Wall -gdwarf-2 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
+CFLAGS += -Wall -gdwarf-2 -DF_CPU=20000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d
## Assembly specific flags
@@ -36,6 +36,15 @@ HEX_EEPROM_FLAGS += --set-section-flags=.eeprom="alloc,load"
HEX_EEPROM_FLAGS += --change-section-lma .eeprom=0 --no-change-warnings
+## Include Directories
+INCLUDES = -I"C:\avr8-gnu-toolchain-win32_x86\avr\include"
+
+## Library Directories
+LIBDIRS = -L"C:\avr8-gnu-toolchain-win32_x86\avr\lib"
+
+## Libraries
+LIBS = -lc
+
## Objects that must be built in order to link
OBJECTS = main.o spi.o
diff --git a/main.c b/main.c
deleted file mode 100644
index d085acc..0000000
--- a/main.c
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-int main() {
- return 0;
-}
diff --git a/main.cpp b/main.cpp
new file mode 100644
index 0000000..4b50465
--- /dev/null
+++ b/main.cpp
@@ -0,0 +1,7 @@
+#include "spi.h"
+
+int main() {
+
+ SPI spi_master;
+ return 0;
+}
diff --git a/spi.h b/spi.h
index e69de29..56e5286 100644
--- a/spi.h
+++ b/spi.h
@@ -0,0 +1,13 @@
+#ifndef SPI_H
+#define SPI_H
+
+#include
+
+class SPI {
+
+
+ private: int d;
+
+};
+
+#endif