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
37
37
ARDUINO_CORE_PATH = $(ARDUINO_DIR ) /hardware/teensy/avr/cores/teensy3
38
38
BOARDS_TXT = $(ARDUINO_DIR ) /hardware/$(ARDMK_VENDOR ) /avr/boards.txt
39
39
40
- ifndef F_CPU
41
- F_CPU =96000000
42
- endif
43
40
44
41
ifndef PARSE_TEENSY
45
42
# result = $(call READ_BOARD_TXT, 'boardname', 'parameter')
46
43
PARSE_TEENSY = $(shell grep -v "^\#" "$(BOARDS_TXT ) " | grep $(1 ) .$(2 ) | cut -d = -f 2- )
47
44
endif
48
45
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
+
49
58
# if boards.txt gets modified, look there, else hard code it
50
59
ARCHITECTURE = $(call PARSE_TEENSY,$(BOARD_TAG ) ,build.architecture)
51
60
ifeq ($(strip $(ARCHITECTURE ) ) ,)
You can’t perform that action at this time.
0 commit comments