Skip to content
This repository has been archived by the owner on Jul 6, 2020. It is now read-only.

Commit

Permalink
Hibike/mac flash (#493)
Browse files Browse the repository at this point in the history
  • Loading branch information
tingtingchiang authored Feb 1, 2018
1 parent 128061f commit 196bdf0
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 3 deletions.
11 changes: 9 additions & 2 deletions hibike/Arduino-Makefile/Arduino.mk
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,12 @@
#
# On the Mac you might want to set:
#
# ARDUINO_DIR = /Applications/Arduino.app/Contents/Resources/Java
# ARDMK_DIR = /usr/local
# ARDUINO_DIR = /Applications/Arduino.app/Contents/Java
# AVR_TOOLS_DIR = ${ARDUINO_DIR}/hardware/tools/avr
# AVRDUDE_CONF = $(AVR_TOOLS_DIR)/etc/avrdude.conf
# AVRDUDE = ${AVR_TOOLS_DIR}/bin/avrdude
# MONITOR_PORT = /dev/tty.usbmodem*

#
# On Linux, you might prefer:
#
Expand Down Expand Up @@ -397,10 +401,12 @@ ifndef NM_NAME
NM_NAME = avr-nm
endif


ifndef AVR_TOOLS_DIR

BUNDLED_AVR_TOOLS_DIR := $(call dir_if_exists,$(ARDUINO_DIR)/hardware/tools/avr)


ifdef BUNDLED_AVR_TOOLS_DIR
AVR_TOOLS_DIR = $(BUNDLED_AVR_TOOLS_DIR)
$(call show_config_variable,AVR_TOOLS_DIR,[BUNDLED],(in Arduino distribution))
Expand Down Expand Up @@ -467,6 +473,7 @@ endif
ARDUINO_LIB_PATH = $(ARDUINO_DIR)/libraries
$(call show_config_variable,ARDUINO_LIB_PATH,[COMPUTED],(from ARDUINO_DIR))


# 1.5.x platform dependent libs path
ifndef ARDUINO_PLATFORM_LIB_PATH
ifeq ($(shell expr $(ARDUINO_VERSION) '>' 150), 1)
Expand Down
2 changes: 1 addition & 1 deletion hibike/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ LOCAL_CPP_SRCS := $(wildcard $(PROJECT_DIR)/devices/$(DEVICE)/*.cpp)

### MONITOR_PORT
### The port your board is connected to. Using an '*' tries all the ports and finds the right one.
MONITOR_PORT = /dev/ttyACM*
# MONITOR_PORT = /dev/ttyACM*

### Don't touch this
CURRENT_DIR = $(shell basename $(CURDIR))
Expand Down
53 changes: 53 additions & 0 deletions hibike/mac_setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash
# THIS FILE ASSUMES YOU HAVE HOMEBREW AND X-CODE INSTALLED ON YOUR MAC.

if [[ "$(id -u)" == "0" ]]; then
echo "Please run without sudo permissions."
exit 1
fi

deps=("make" "gcc" "gcc-avr" "arduino-mk" "python3-pip")

if ! type make >/dev/null 2>&1 || ! type gcc >/dev/null 2>&1; then
echo "Install x-code on your mac!"
exit 1
fi

if ! type avr-gcc >/dev/null 2>&1; then
echo "Installing avr-gcc: Warning, install will take a long time."
brew tap osx-cross/avr
brew install avr-gcc
fi

if [[ $(brew list | grep -c arduino-mk) == 0 ]]; then
echo" Installing arduino-mk: Warning, install will take a long time."
# add tap
brew tap sudar/arduino-mk
# to install the last stable release
brew install arduino-mk
# to install the development version
brew install --HEAD arduino-mk
fi

if ! type pip3 >/dev/null 2>&1; then
brew install python3
fi


if ! command -v pipenv &> /dev/null; then
pip3 install pipenv
fi

pipenv install --dev
pip3 install serial
echo "All dependencies installed."

echo "Next steps: download Arduino 1.8.1 (should have Arduino.app in Applications folder), python should map to python3 or you will get an error."

echo " ARDUINO_DIR = /Applications/Arduino.app/Contents/Java
AVR_TOOLS_DIR = \${ARDUINO_DIR}/hardware/tools/avr
AVRDUDE_CONF = \$(AVR_TOOLS_DIR)/etc/avrdude.conf
AVRDUDE = \${AVR_TOOLS_DIR}/bin/avrdude
MONITOR_PORT = /dev/tty.usbmodem*
" |cat - Arduino-Makefile/Arduino.mk > /tmp/out && mv /tmp/out Arduino-Makefile/Arduino.mk

0 comments on commit 196bdf0

Please sign in to comment.