Skip to content

Commit

Permalink
add teensy loader cli to repo
Browse files Browse the repository at this point in the history
  • Loading branch information
bolandrm committed May 8, 2016
1 parent 067c254 commit 4a2683f
Show file tree
Hide file tree
Showing 14 changed files with 4,674 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ CPPFLAGS += -D__MK20DX256__ -DTEENSYDUINO=128

include ../build_scripts/Teensy.mk

TEENSY_LOADER_CLI = ~/hardware/teensy_loader_cli/teensy_loader_cli
TEENSY_LOADER_CLI = ../teensy_loader_cli/teensy_loader_cli
REBOOT_TEENSY = stty -f $(MONITOR_PORT) 134

burn:
Expand Down
1 change: 1 addition & 0 deletions teensy_loader_cli/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
teensy_loader_cli
40 changes: 40 additions & 0 deletions teensy_loader_cli/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#OS ?= LINUX
#OS ?= WINDOWS
OS ?= MACOSX
#OS ?= BSD

ifeq ($(OS), LINUX) # also works on FreeBSD
CC ?= gcc
CFLAGS ?= -O2 -Wall
teensy_loader_cli: teensy_loader_cli.c
$(CC) $(CFLAGS) -s -DUSE_LIBUSB -o teensy_loader_cli teensy_loader_cli.c -lusb


else ifeq ($(OS), WINDOWS)
CC = i586-mingw32msvc-gcc
CFLAGS ?= -O2 -Wall
teensy_loader_cli.exe: teensy_loader_cli.c
$(CC) $(CFLAGS) -s -DUSE_WIN32 -o teensy_loader_cli.exe teensy_loader_cli.c -lhid -lsetupapi


else ifeq ($(OS), MACOSX)
CC ?= gcc
SDK ?= $(shell xcrun --show-sdk-path)
#SDK ?= /Developer/SDKs/MacOSX10.5.sdk # the old way...
CFLAGS ?= -O2 -Wall
teensy_loader_cli: teensy_loader_cli.c
$(CC) $(CFLAGS) -DUSE_APPLE_IOKIT -isysroot $(SDK) -o teensy_loader_cli teensy_loader_cli.c -Wl,-syslibroot,$(SDK) -framework IOKit -framework CoreFoundation


else ifeq ($(OS), BSD) # works on NetBSD and OpenBSD
CC ?= gcc
CFLAGS ?= -O2 -Wall
teensy_loader_cli: teensy_loader_cli.c
$(CC) $(CFLAGS) -s -DUSE_UHID -o teensy_loader_cli teensy_loader_cli.c


endif


clean:
rm -f teensy_loader_cli teensy_loader_cli.exe
21 changes: 21 additions & 0 deletions teensy_loader_cli/Makefile.bsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
OS ?= FreeBSD
#OS ?= NetBSD
#OS ?= OpenBSD

CFLAGS ?= -O2 -Wall
CC ?= gcc

.if $(OS) == "FreeBSD"
CFLAGS += -DUSE_LIBUSB
LIBS = -lusb
.elif $(OS) == "NetBSD" || $(OS) == "OpenBSD"
CFLAGS += -DUSE_UHID
LIBS =
.endif


teensy_loader_cli: teensy_loader_cli.c
$(CC) $(CFLAGS) -s -o teensy_loader_cli teensy_loader_cli.c $(LIBS)

clean:
rm -f teensy_loader_cli
8 changes: 8 additions & 0 deletions teensy_loader_cli/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#Teensy Loader - Command Line Version#

The Teensy Loader is available in a command line version for advanced users who want to automate programming, typically using a Makefile. For most uses, the graphical version in Automatic Mode is much easier.

http://www.pjrc.com/teensy/loader_cli.html

![Teensy 3.1](http://www.pjrc.com/teensy/teensy31_front_small_green.jpg)

Loading

0 comments on commit 4a2683f

Please sign in to comment.