diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..499a618 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.o +*.swp diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a8a2cc4 --- /dev/null +++ b/Makefile @@ -0,0 +1,31 @@ +CC = gcc +CXX = g++ +AR = ar +LD = g++ +CFLAGS = -Wall -fexceptions -lpthread -lm -O3 -fpermissive -fno-strict-aliasing +TARGET = fm_transmitter + +all: release + +OBJS = main.o wave_reader.o stdin_reader.o error_reporter.o transmitter.o + +release: $(OBJS) + $(LD) $(CFLAGS) -o $(TARGET) $(OBJS) + +wave_reader.o: wave_reader.cpp wave_reader.h + $(CC) $(CFLAGS) -c wave_reader.cpp + +stdin_reader.o: stdin_reader.cpp + $(CC) $(CFLAGS) -c stdin_reader.cpp + +error_reporter.o: error_reporter.cpp + $(CC) $(CFLAGS) -c error_reporter.cpp + +transmitter.o: transmitter.cpp + $(CC) $(CFLAGS) -c transmitter.cpp + +main.o: main.cpp + $(CC) $(CFLAGS) -c main.cpp + +clean: + rm *.o diff --git a/README.md b/README.md index 92392a8..1f2ef1b 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,12 @@ Use Raspberry Pi as FM transmitter. Now supports both RPi 1 and RPi 2 boards. This project uses the general clock output to produce frequency modulated radio communication. It is based on idea originaly posted here: [http://icrobotics.co.uk/wiki/index.php/Turning_the_Raspberry_Pi_Into_an_FM_Transmitter](http://icrobotics.co.uk/wiki/index.php/Turning_the_Raspberry_Pi_Into_an_FM_Transmitter), but does not use DMA controller in order to distribute samples to output (clock generator),so sound quality is worse as in PiFm project and only mono transmition is available but this makes possible to run it on all kind of boards. +## Compile +``` +sudo apt-get install make gcc g++ +make +``` + ## How to use it To compile this project you can use Code::Blocks IDE [(http://codeblocks.org/)](http://codeblocks.org/) or alternatively convert CBP file into makefile.