File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -37,15 +37,24 @@ ARDMK_VENDOR = teensy
3737ARDUINO_CORE_PATH = $(ARDUINO_DIR ) /hardware/teensy/avr/cores/teensy3
3838BOARDS_TXT = $(ARDUINO_DIR ) /hardware/$(ARDMK_VENDOR ) /avr/boards.txt
3939
40- ifndef F_CPU
41- F_CPU =96000000
42- endif
4340
4441ifndef PARSE_TEENSY
4542 # result = $(call READ_BOARD_TXT, 'boardname', 'parameter')
4643 PARSE_TEENSY = $(shell grep -v "^\#" "$(BOARDS_TXT ) " | grep $(1 ) .$(2 ) | cut -d = -f 2- )
4744endif
4845
46+
47+ ifndef F_CPU
48+ ifndef BOARD_SUB
49+ SPEEDS := $(call PARSE_TEENSY,"$(BOARD_TAG ) ,menu.speed.* .build.fcpu") # Obtain sequence of supported frequencies.
50+ SPEEDS := $(shell printf "% d\n" $(SPEEDS ) | sort -g) # Sort it, just in case. Printf to re-append newlines so that sort works.
51+ F_CPU := $(lastword $(SPEEDS ) ) # List is sorted in ascending order. Take the fastest speed.
52+ # $(info "speeds is " $(SPEEDS)) # Good for debugging
53+ else
54+ F_CPU := $(call PARSE_TEENSY,$(BOARD_TAG ) ,menu.speed.$(BOARD_SUB ) .build.fcpu)
55+ endif
56+ endif
57+
4958# if boards.txt gets modified, look there, else hard code it
5059ARCHITECTURE = $(call PARSE_TEENSY,$(BOARD_TAG ) ,build.architecture)
5160ifeq ($(strip $(ARCHITECTURE ) ) ,)
You can’t perform that action at this time.
0 commit comments