Skip to content

Commit 6218431

Browse files
reorganize hardware + create chips
1 parent e288a4e commit 6218431

File tree

22 files changed

+52
-234
lines changed

22 files changed

+52
-234
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
tools/mkromfs
88
*~
99
.DS_Store
10+
*.pdf

Makefile

+10-1
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ clean: clean-generic
1414
$(Q)$(MAKE) $(MAKE_OPTS) -C acorn clean
1515
$(Q)$(MAKE) $(MAKE_OPTS) -C lwip clean
1616
$(Q)$(MAKE) $(MAKE_OPTS) -C tools clean
17+
$(Q)$(MAKE) $(MAKE_OPTS) -C chips clean
1718

18-
.PHONY: libs FreeRTOS arch hardware os libc libm acorn lwip tools deps
19+
.PHONY: libs FreeRTOS arch chips hardware os libc libm acorn lwip tools deps
1920

2021
FreeRTOS/libFreeRTOS.a: FreeRTOS
2122
arch/libarch.a: arch
@@ -25,6 +26,7 @@ libc/libc.a: libc
2526
libm/libm.a: libm
2627
acorn/libacorn.a: acorn
2728
lwip/liblwip.a: lwip
29+
chips/libchips.a: chips
2830

2931
libs: FreeRTOS arch hardware os libc libm acorn lwip
3032

@@ -60,6 +62,10 @@ lwip:
6062
$(E) "[MAKE] Entering lwip"
6163
$(Q)$(MAKE) $(MAKE_OPTS) -C lwip
6264

65+
chips:
66+
$(E) "[MAKE] Entering chips"
67+
$(Q)$(MAKE) $(MAKE_OPTS) -C chips
68+
6369
tools:
6470
$(E) "[MAKE] Entering tools"
6571
$(Q)$(MAKE) $(MAKE_OPTS) -C tools
@@ -81,6 +87,8 @@ deps: ldeps
8187
$(Q)$(MAKE) $(MAKE_OPTS) -C acorn ldeps
8288
$(E) "[DEPS] Creating dependency tree for lwip"
8389
$(Q)$(MAKE) $(MAKE_OPTS) -C lwip ldeps
90+
$(E) "[DEPS] Creating dependency tree for chips"
91+
$(Q)$(MAKE) $(MAKE_OPTS) -C chips ldeps
8492

8593
include arch/config.mk
8694
include FreeRTOS/config.mk
@@ -90,4 +98,5 @@ include libc/config.mk
9098
include libm/config.mk
9199
include lwip/config.mk
92100
include acorn/config.mk
101+
include chips/config.mk
93102
include target-rules.mk

arch/config.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ ifeq ($(BOARD),stm32f429discovery)
4747
TARGET_INCLUDES += $(ROOTDIR)/arch/arm/stm32f4xx/stm32f429discovery
4848
TARGET_CPPFLAGS += -DHSE_VALUE=8000000
4949
TARGET_CPPFLAGS += -DPLL_M=8
50-
LDSCRIPT = $(ROOTDIR)/arch/arm/stm32f4xx/stm32f429.ld
50+
LDSCRIPT = $(ROOTDIR)/arch/arm/stm32f4xx/stm32f40x.ld
5151
endif
5252

5353
endif

chips/Makefile

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
TARGET_LIB = libchips.a
2+
3+
all: $(TARGET_LIB)
4+
5+
include $(ROOTDIR)/common.mk
6+
include $(ROOTDIR)/arch/config.mk
7+
include config.mk
8+
include $(ROOTDIR)/FreeRTOS/config.mk
9+
include $(ROOTDIR)/libc/config.mk
10+
include $(ROOTDIR)/hardware/config.mk
11+
12+
TARGET_SRCS = \
13+
src/sdcard.c \
14+
15+
include $(ROOTDIR)/target-rules.mk
16+
17+
clean: clean-generic

chips/config.mk

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
TARGET_INCLUDES += $(ROOTDIR)/chips/include
File renamed without changes.
File renamed without changes.

hardware/Makefile

+13-12
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,26 @@ include config.mk
88
include $(ROOTDIR)/FreeRTOS/config.mk
99
include $(ROOTDIR)/libc/config.mk
1010

11-
TARGET_SRCS = \
12-
src/sdcard.c \
13-
1411
ifeq ($(CPU_SUBFAMILY),CM3)
1512
ifeq ($(CPU_FLAVOR),lpc17xx)
16-
TARGET_SRCS += src/gpio-lpc17xx.c
17-
TARGET_SRCS += src/ssp-lpc17xx.c
13+
TARGET_SRCS += src/lpc17xx/gpio.c
14+
TARGET_SRCS += src/lpc17xx/ssp.c
15+
endif
16+
17+
ifeq ($(CPU_FLAVOR),stm32f10x)
18+
TARGET_SRCS += src/stm32f10x/i2c.c
19+
TARGET_SRCS += src/stm32f10x/uart.c
1820
endif
1921
endif
2022

2123
ifeq ($(CPU_SUBFAMILY),CM4F)
2224
ifeq ($(CPU_FLAVOR),stm32f4xx)
23-
TARGET_SRCS += src/adc-stm32f4xx.c
24-
TARGET_SRCS += src/gpio-stm32f4xx.c
25-
TARGET_SRCS += src/i2c-stm32f4xx.c
26-
TARGET_SRCS += src/timer-stm32f4xx.c
27-
TARGET_SRCS += src/spi-stm32f4xx.c
28-
TARGET_SRCS += src/ssp-stm32f4xx.c
29-
TARGET_SRCS += src/uart-stm32f4xx.c
25+
TARGET_SRCS += src/stm32f4xx/adc.c
26+
TARGET_SRCS += src/stm32f4xx/gpio.c
27+
TARGET_SRCS += src/stm32f4xx/i2c.c
28+
TARGET_SRCS += src/stm32f4xx/ssp.c
29+
TARGET_SRCS += src/stm32f4xx/timer.c
30+
TARGET_SRCS += src/stm32f4xx/uart.c
3031
endif
3132
endif
3233

hardware/config.mk

+7
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
11
TARGET_INCLUDES += $(ROOTDIR)/hardware/include
2+
3+
4+
ifeq ($(CPU_SUBFAMILY),CM4F)
5+
ifeq ($(CPU_FLAVOR),stm32f4xx)
6+
TARGET_INCLUDES += $(ROOTDIR)/hardware/src/stm32f4xx
7+
endif
8+
endif
File renamed without changes.
File renamed without changes.

hardware/src/spi-stm32f4xx.c

-218
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

hardware/src/gpio-stm32f4xx.c renamed to hardware/src/stm32f4xx/gpio.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include <stm32f4xx.h>
22
#include <stm32f4xx_gpio.h>
3-
#include "stm32f4xx-hardware.h"
3+
#include "hardware.h"
44

55
#include <gpio.h>
66

File renamed without changes.
File renamed without changes.

hardware/src/ssp-stm32f4xx.c renamed to hardware/src/stm32f4xx/ssp.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include "ssp.h"
2-
#include "stm32f4xx-hardware.h"
2+
#include "hardware.h"
33

44
#include <stm32f4xx.h>
55
#include <stm32f4xx_gpio.h>
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)