|
20 | 20 | #
|
21 | 21 | # ##############################################################################
|
22 | 22 |
|
23 |
| -if(CONFIG_ARCH_CHIP_LM) |
24 |
| - set(ARCH_CHIP lm) |
25 |
| -elseif(CONFIG_ARCH_CHIP_TM4C) |
26 |
| - set(ARCH_CHIP tm4c) |
27 |
| -elseif(CONFIG_ARCH_CHIP_CC13X0) |
28 |
| - set(ARCH_CHIP cc13xx) |
29 |
| -elseif(CONFIG_ARCH_CHIP_CC13X2) |
30 |
| - set(ARCH_CHIP cc13xx) |
31 |
| -endif() |
32 |
| - |
33 |
| -set(SRCS) |
34 |
| - |
35 |
| -if(NOT CONFIG_ARCH_IDLE_CUSTOM) |
36 |
| - list(APPEND SRCS tiva_idle.c) |
37 |
| -endif() |
| 23 | +# Paths to source files |
38 | 24 |
|
39 |
| -list(APPEND SRCS tiva_allocateheap.c tiva_irq.c tiva_lowputc.c tiva_serial.c) |
40 |
| -list(APPEND SRCS tiva_ssi.c) |
| 25 | +add_subdirectory(common) |
41 | 26 |
|
42 |
| -if(CONFIG_ARCH_CHIP_LM3S) |
43 |
| - list(APPEND SRCS lmxx_tm4c_start.c lm3s_gpio.c lmxx_tm4c_gpioirq.c) |
44 |
| - list(APPEND SRCS lm4xx_tm3c_sysctrl.c) |
45 |
| -elseif(CONFIG_ARCH_CHIP_LM4F) |
46 |
| - list(APPEND SRCS lmxx_tm4c_start.c lm4f_gpio.c lmxx_tm4c_gpioirq.c) |
47 |
| - list(APPEND SRCS lm4xx_tm3c_sysctrl.c) |
| 27 | +if(CONFIG_ARCH_CHIP_LM) |
| 28 | + add_subdirectory(lm) |
48 | 29 | elseif(CONFIG_ARCH_CHIP_TM4C)
|
49 |
| - list(APPEND SRCS lmxx_tm4c_start.c tm4c_gpio.c lmxx_tm4c_gpioirq.c) |
50 |
| - if(CONFIG_ARCH_CHIP_TM4C129) |
51 |
| - list(APPEND SRCS tm4c129_sysctrl.c) |
52 |
| - else() |
53 |
| - list(APPEND SRCS lm4xx_tm3c_sysctrl.c) |
54 |
| - endif() |
55 |
| - |
56 |
| -elseif(CONFIG_ARCH_CHIP_CC13X0) |
57 |
| - list(APPEND SRCS cc13xx_start.c cc13xx_prcm.c cc13xx_chipinfo.c cc13xx_gpio.c) |
58 |
| - list(APPEND SRCS cc13xx_gpioirq.c cc13xx_enableclks.c cc13xx_enablepwr.c) |
59 |
| - list(APPEND SRCS cc13x0_trim.c cc13x0_rom.c) |
60 |
| -elseif(CONFIG_ARCH_CHIP_CC13X2) |
61 |
| - list(APPEND SRCS cc13xx_start.c cc13xx_prcm.c cc13xx_chipinfo.c cc13xx_gpio.c) |
62 |
| - list(APPEND SRCS cc13xx_gpioirq.c cc13xx_enableclks.c cc13xx_enablepwr.c) |
63 |
| - list(APPEND SRCS cc13x2_aux_sysif.c) |
64 |
| - if(CONFIG_ARCH_CHIP_CC13XX_V1) |
65 |
| - list(APPEND SRCS cc13x2_v1_trim.c cc13x2_cc26x2_v1_rom.c) |
66 |
| - else() |
67 |
| - list(APPEND SRCS cc13x2_v2_trim.c) |
68 |
| - endif() |
69 |
| -endif() |
70 |
| - |
71 |
| -if(CONFIG_DEBUG_GPIO_INFO) |
72 |
| - list(APPEND SRCS tiva_dumpgpio.c) |
| 30 | + add_subdirectory(tm4c) |
| 31 | +elseif((CONFIG_ARCH_CHIP_CC13X0) OR (CONFIG_ARCH_CHIP_CC13X2)) |
| 32 | + add_subdirectory(cc13xx) |
73 | 33 | endif()
|
74 |
| - |
75 |
| -if(NOT CONFIG_SCHED_TICKLESS) |
76 |
| - list(APPEND SRCS tiva_timerisr.c) |
77 |
| -endif() |
78 |
| - |
79 |
| -if(CONFIG_BUILD_PROTECTED) |
80 |
| - list(APPEND SRCS tiva_userspace.c tiva_mpuinit.c) |
81 |
| -endif() |
82 |
| - |
83 |
| -if(CONFIG_TIVA_I2C) |
84 |
| - list(APPEND SRCS tiva_i2c.c) |
85 |
| -endif() |
86 |
| - |
87 |
| -if(CONFIG_TIVA_PWM) |
88 |
| - list(APPEND SRCS tiva_pwm.c) |
89 |
| -endif() |
90 |
| - |
91 |
| -if(CONFIG_TIVA_QEI) |
92 |
| - list(APPEND SRCS tiva_qencoder.c) |
93 |
| -endif() |
94 |
| - |
95 |
| -if(CONFIG_TIVA_TIMER) |
96 |
| - list(APPEND SRCS tiva_timerlib.c) |
97 |
| - if(CONFIG_TIVA_TIMER32_PERIODIC) |
98 |
| - list(APPEND SRCS tiva_timerlow32.c) |
99 |
| - endif() |
100 |
| -endif() |
101 |
| - |
102 |
| -if(CONFIG_TIVA_ADC) |
103 |
| - list(APPEND SRCS tiva_adclow.c) |
104 |
| - list(APPEND SRCS tiva_adclib.c) |
105 |
| -endif() |
106 |
| - |
107 |
| -if(CONFIG_TIVA_CAN) |
108 |
| - list(APPEND SRCS tiva_can.c) |
109 |
| -endif() |
110 |
| - |
111 |
| -if(CONFIG_TIVA_ETHERNET) |
112 |
| - if(CONFIG_ARCH_CHIP_LM3S) |
113 |
| - list(APPEND SRCS lm3s_ethernet.c) |
114 |
| - endif() |
115 |
| - if(CONFIG_ARCH_CHIP_TM4C) |
116 |
| - list(APPEND SRCS tm4c_ethernet.c) |
117 |
| - endif() |
118 |
| -endif() |
119 |
| - |
120 |
| -if(CONFIG_TIVA_FLASH) |
121 |
| - list(APPEND SRCS tiva_flash.c) |
122 |
| -endif() |
123 |
| - |
124 |
| -if(CONFIG_TIVA_EEPROM) |
125 |
| - list(APPEND SRCS tiva_eeprom.c) |
126 |
| -endif() |
127 |
| - |
128 |
| -if(CONFIG_TIVA_HCIUART) |
129 |
| - list(APPEND SRCS tiva_hciuart.c) |
130 |
| -endif() |
131 |
| - |
132 |
| -set(COMMON_SRCS) |
133 |
| - |
134 |
| -foreach(src ${SRCS}) |
135 |
| - if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/common/${src}) |
136 |
| - list(APPEND COMMON_SRCS common/${src}) |
137 |
| - else() |
138 |
| - list(APPEND COMMON_SRCS ${ARCH_CHIP}/${src}) |
139 |
| - endif() |
140 |
| -endforeach() |
141 |
| - |
142 |
| -target_sources(arch PRIVATE ${COMMON_SRCS}) |
0 commit comments