init repo

This commit is contained in:
Tristan Krause 2019-03-26 09:57:01 +01:00
commit a68bb3aecc
8 changed files with 79 additions and 0 deletions

32
Makefile Normal file
View file

@ -0,0 +1,32 @@
# Name: Makefile
# Project: B15F (board15 Famulus Edition)
# Author: Tristan Krause
# Creation Date: 2019-03-22
# Umgebungseinstellungen
COMPILER_PATH = g++
OUTPUT = main
CFLAGS = -std=c++14 -O3
LDFLAGS =
OBJECTS = main.o drv/b15f.o
COMPILE = $(COMPILER_PATH) $(CFLAGS)
B15F: $(OBJECTS)
@echo "Linking..."
$(COMPILE) $(OBJECTS) -o $(OUTPUT) $(LDFLAGS)
help:
@echo "This Makefile has the following rules:"
@echo "make B15F .... to compile (default)"
@echo "make clean ... to delete objects, elf and hex file"
clean:
@echo "Cleaning..."
rm -f $(OBJECTS) $(OUTPUT)
.cpp.o:
$(COMPILE) -c $< -o $@

BIN
drv/.b15f.cpp.swp Normal file

Binary file not shown.

20
drv/b15f.cpp Normal file
View file

@ -0,0 +1,20 @@
#include "b15f.h"
B15F* B15F::instance = nullptr;
B15F::B15F()
{
}
void B15F::init(void)
{
std::cout << "moint: " << std::endl;
}
B15F& B15F::getInstance(void)
{
if(!instance)
instance = new B15F();
return *instance;
}

18
drv/b15f.h Normal file
View file

@ -0,0 +1,18 @@
#ifndef B15F_h
#define B15F_h
#include <iostream>
class B15F
{
private:
B15F(void); // privater Konstruktor
public:
void init(void);
static B15F& getInstance(void);
private:
static B15F* instance;
};
#endif // B15F_h

BIN
drv/b15f.o Normal file

Binary file not shown.

BIN
main Executable file

Binary file not shown.

9
main.cpp Normal file
View file

@ -0,0 +1,9 @@
#include <iostream>
#include "drv/b15f.h"
int main()
{
B15F& drv = B15F::getInstance();
drv.init();
std::cout << "heelol" << std::endl;
}

BIN
main.o Normal file

Binary file not shown.