Skip to content
Snippets Groups Projects
Commit b29cbc12 authored by Micah Elizabeth Scott's avatar Micah Elizabeth Scott
Browse files

Standalone build without the Arduino IDE

parent 760475eb
No related branches found
No related tags found
No related merge requests found
# Compiled Object files
*.slo
*.lo
*.elf
*.hex
*.o
# Compiled Dynamic libraries
*.so
*.dylib
# Compiled Static libraries
*.lai
*.la
*.a
*.d
Makefile 0 → 100644
# The name of your project (used to name the compiled .hex file)
TARGET = fadecandy
# configurable options
OPTIONS = -DF_CPU=48000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH
# options needed by many Arduino libraries to configure for Teensy 3.0
OPTIONS += -D__MK20DX128__ -DARDUIO=104 -DARDUINO
# Sources
C_FILES = $(wildcard src/*.c) $(wildcard teensy3/*.c)
CPP_FILES = $(wildcard src/*.cpp) $(wildcard teensy3/*.cpp)
# Headers
INCLUDES = -Isrc -Iteensy3
# CPPFLAGS = compiler options for C and C++
CPPFLAGS = -Wall -g -Os -mcpu=cortex-m4 -mthumb -nostdlib -MMD $(OPTIONS) $(INCLUDES)
# compiler options for C++ only
CXXFLAGS = -std=gnu++0x -felide-constructors -fno-exceptions -fno-rtti
# compiler options for C only
CFLAGS =
# linker script
LDSCRIPT = teensy3/mk20dx128.ld
# linker options
LDFLAGS = -Os -Wl,--gc-sections -mcpu=cortex-m4 -mthumb -T$(LDSCRIPT)
# additional libraries to link
LIBS = -lm
# toolchain
CC = arm-none-eabi-gcc
CXX = arm-none-eabi-g++
OBJCOPY = arm-none-eabi-objcopy
SIZE = arm-none-eabi-size
OBJS := $(C_FILES:.c=.o) $(CPP_FILES:.cpp=.o)
all: $(TARGET).hex
$(TARGET).elf: $(OBJS) $(LDSCRIPT)
$(CC) $(LDFLAGS) -o $@ $(OBJS)
%.hex: %.elf
$(SIZE) $<
$(OBJCOPY) -O ihex -R .eeprom $< $@
# compiler generated dependency info
-include $(OBJS:.o=.d)
clean:
rm -f src/*.d src/*.o teensy3/*.o teensy3/*.d $(TARGET).elf $(TARGET).hex
.PHONY: clean install
File moved
......@@ -21,13 +21,13 @@ void setup()
leds.begin();
for (unsigned i = 0; i < ledsTotal; ++i) {
pixbuf.pixels[i].color = HColor16(0x1080, 0x0080, 0x0080);
pixbuf.pixels[i].color = HColor16(0x0080, 0x0080, 0x0080);
}
}
void loop()
{
pixbuf.pixels[0].color.r = millis() & 0xffff;
pixbuf.pixels[0].color.b = millis() & 0xffff;
pixbuf.show(leds);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment