Skip to content

Commit

Permalink
More STM32F3 support
Browse files Browse the repository at this point in the history
  • Loading branch information
simondlevy committed Aug 7, 2018
1 parent 4d27bee commit fe3580b
Show file tree
Hide file tree
Showing 22 changed files with 2,267 additions and 354 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
extras/parser/output
parser/output
*.d
*.i
*.s
*.o
*.swp
*~
Expand Down
2 changes: 1 addition & 1 deletion extras/stm32f3/alienflightf3/examples/Blink/Blink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// give it a name:
int led = 4;

#include <Arduino.h>
#include <main.h>

// the setup routine runs once when you press reset:
void setup() {
Expand Down
22 changes: 9 additions & 13 deletions extras/stm32f3/alienflightf3/examples/Blink/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,14 @@
# You should have received a copy of the GNU Lesser General Public License
# along with this code. If not, see <http://www.gnu.org/licenses/>.

# Change this to wherever you put BreezySTM32
BREEZY_DIR = $(HOME)/Desktop/BreezySTM32

# Change this to where you put your Arduino libraries
ARDUINO_DIR = $(HOME)/Development/arduino-1.8.1/hardware/teensy/avr/libraries
ARDUINO_DIR = $(HOME)/Documents/Arduino/libraries

# Change this to whatever project name you want
PROJECT = Blink

###############################################################################

F3_DIR = $(BREEZY_DIR)/f3
F3_DIR = ../../..
ALIENFLIGHTF3_DIR = $(F3_DIR)/alienflightf3

# Debugger optons, must be empty or GDB
Expand All @@ -46,18 +42,18 @@ SRC_DIR = $(ALIENFLIGHTF3_DIR)
OBJECT_DIR = $(ROOT)/obj
BIN_DIR = $(ROOT)/obj
#CMSIS_DIR = $(ROOT)/lib/CMSIS
CMSIS_DIR = $(BREEZY_DIR)/lib/CMSIS
INCLUDE_DIRS = $(BREEZY_DIR) $(F3_DIR) $(ALIENFLIGHTF3_DIR) $(SRC_DIR) $(SRC_DIR)/target
CMSIS_DIR = $(F3_DIR)/lib/CMSIS
INCLUDE_DIRS = $(F3_DIR) $(F3_DIR) $(ALIENFLIGHTF3_DIR) $(SRC_DIR) $(SRC_DIR)/target
LINKER_DIR = $(F3_DIR)

# Search path for sources
VPATH := $(SRC_DIR):$(SRC_DIR)/startup
USBFS_DIR = $(BREEZY_DIR)/lib/STM32_USB-FS-Device_Driver
USBFS_DIR = $(F3_DIR)/lib/STM32_USB-FS-Device_Driver
USBPERIPH_SRC = $(notdir $(wildcard $(USBFS_DIR)/src/*.c))

CSOURCES := $(shell find $(SRC_DIR) -name '*.c')

STDPERIPH_DIR = $(BREEZY_DIR)/lib/STM32F30x_StdPeriph_Driver
STDPERIPH_DIR = $(F3_DIR)/lib/STM32F30x_StdPeriph_Driver

STDPERIPH_SRC = $(notdir $(wildcard $(STDPERIPH_DIR)/src/*.c))

Expand Down Expand Up @@ -213,7 +209,7 @@ TARGET_BIN = obj/$(PROJECT).bin
TARGET_HEX = $(BIN_DIR)/$(PROJECT).hex
TARGET_ELF = $(OBJECT_DIR)/$(PROJECT).elf
TARGET_OBJS = $(addsuffix .o,$(addprefix $(OBJECT_DIR)/$(PROJECT)/,$(basename $($(PROJECT)_CSRC)))) \
$(OBJECT_DIR)/$(PROJECT)/Arduino.o \
$(OBJECT_DIR)/$(PROJECT)/main.o \
$(OBJECT_DIR)/$(PROJECT).o
TARGET_MAP = $(OBJECT_DIR)/$(PROJECT).map

Expand Down Expand Up @@ -261,8 +257,8 @@ $(OBJECT_DIR)/$(PROJECT)/%.o: %.S
@echo %% $(notdir $<)
@$(CC) -c -o $@ $(ASFLAGS) $<

$(OBJECT_DIR)/$(PROJECT)/Arduino.o: $(F3_DIR)/Arduino.cpp $(BREEZY_DIR)/Arduino.h
@$(CC) -c -o $(OBJECT_DIR)/$(PROJECT)/Arduino.o $(CFLAGS) $(F3_DIR)/Arduino.cpp
$(OBJECT_DIR)/$(PROJECT)/main.o: $(F3_DIR)/main.cpp $(F3_DIR)/main.h
@$(CC) -c -o $(OBJECT_DIR)/$(PROJECT)/main.o $(CFLAGS) $(F3_DIR)/main.cpp

$(OBJECT_DIR)/$(PROJECT).o: ./$(PROJECT).cpp
@$(CC) -c -o $(OBJECT_DIR)/$(PROJECT).o $(CFLAGS) ./$(PROJECT).cpp
Expand Down
2 changes: 1 addition & 1 deletion extras/stm32f3/Arduino.cpp → extras/stm32f3/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void serialEvent3(void) __attribute__((weak));

extern "C" {

#include <Arduino.h>
#include <main.h>

#include "platform.h"

Expand Down
File renamed without changes.
70 changes: 0 additions & 70 deletions extras/stm32f3/spracingf3/examples/Interrupt/Interrupt.cpp

This file was deleted.

Loading

0 comments on commit fe3580b

Please sign in to comment.