mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-08-28 00:28:38 +08:00
修改配置选项,添加条件编译
This commit is contained in:
@@ -344,9 +344,7 @@ CONFIG_BSP_USING_GPIO=y
|
||||
CONFIG_BSP_USING_UART=y
|
||||
CONFIG_BSP_USING_UART2=y
|
||||
# CONFIG_BSP_UART2_RX_USING_DMA is not set
|
||||
# CONFIG_BSP_USING_I2C1 is not set
|
||||
# CONFIG_BSP_USING_I2C2 is not set
|
||||
# CONFIG_BSP_USING_I2C3 is not set
|
||||
# CONFIG_BSP_USING_I2C is not set
|
||||
# CONFIG_BSP_USING_ONCHIP_RTC is not set
|
||||
|
||||
#
|
||||
|
||||
@@ -30,67 +30,66 @@ menu "On-chip Peripheral Drivers"
|
||||
config BSP_USING_UART2
|
||||
bool "Enable UART2"
|
||||
default n
|
||||
|
||||
config BSP_UART2_RX_USING_DMA
|
||||
bool "Enable UART2 RX DMA"
|
||||
depends on BSP_USING_UART2 && RT_SERIAL_USING_DMA
|
||||
default n
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_I2C1
|
||||
bool "Enable I2C1 BUS (software simulation)"
|
||||
menuconfig BSP_USING_I2C
|
||||
bool "Enable I2C (software simulation)"
|
||||
default n
|
||||
select RT_USING_I2C
|
||||
select RT_USING_I2C_BITOPS
|
||||
select RT_USING_PIN
|
||||
if BSP_USING_I2C1
|
||||
config BSP_I2C1_SCL_PIN
|
||||
int "i2c1 scl pin number"
|
||||
range 1 176
|
||||
default 22
|
||||
config BSP_I2C1_SDA_PIN
|
||||
int "I2C1 sda pin number"
|
||||
range 1 176
|
||||
default 23
|
||||
endif
|
||||
if BSP_USING_I2C
|
||||
config BSP_USING_I2C1
|
||||
bool "Enable I2C1 BUS (software simulation)"
|
||||
default n
|
||||
if BSP_USING_I2C1
|
||||
config BSP_I2C1_SCL_PIN
|
||||
int "i2c1 scl pin number"
|
||||
range 1 176
|
||||
default 22
|
||||
config BSP_I2C1_SDA_PIN
|
||||
int "I2C1 sda pin number"
|
||||
range 1 176
|
||||
default 23
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_I2C2
|
||||
bool "Enable I2C2 BUS (software simulation)"
|
||||
default n
|
||||
select RT_USING_I2C
|
||||
select RT_USING_I2C_BITOPS
|
||||
select RT_USING_PIN
|
||||
if BSP_USING_I2C2
|
||||
config BSP_I2C2_SCL_PIN
|
||||
int "i2c2 scl pin number"
|
||||
range 1 176
|
||||
default 26
|
||||
config BSP_I2C2_SDA_PIN
|
||||
int "I2C2 sda pin number"
|
||||
range 1 176
|
||||
default 27
|
||||
endif
|
||||
config BSP_USING_I2C2
|
||||
bool "Enable I2C2 BUS (software simulation)"
|
||||
default n
|
||||
if BSP_USING_I2C2
|
||||
config BSP_I2C2_SCL_PIN
|
||||
int "i2c2 scl pin number"
|
||||
range 1 176
|
||||
default 26
|
||||
config BSP_I2C2_SDA_PIN
|
||||
int "I2C2 sda pin number"
|
||||
range 1 176
|
||||
default 27
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_I2C3
|
||||
bool "Enable I2C3 BUS (software simulation)"
|
||||
default n
|
||||
select RT_USING_I2CS
|
||||
select RT_USING_I2C_BITOPS
|
||||
select RT_USING_PIN
|
||||
if BSP_USING_I2C3
|
||||
config BSP_I2C3_SCL_PIN
|
||||
int "i2c3 scl pin number"
|
||||
range 1 176
|
||||
default 32
|
||||
config BSP_I2C3_SDA_PIN
|
||||
int "I2C3 sda pin number"
|
||||
range 1 176
|
||||
default 33
|
||||
config BSP_USING_I2C3
|
||||
bool "Enable I2C3 BUS (software simulation)"
|
||||
default n
|
||||
if BSP_USING_I2C3
|
||||
config BSP_I2C3_SCL_PIN
|
||||
int "i2c3 scl pin number"
|
||||
range 1 176
|
||||
default 32
|
||||
config BSP_I2C3_SDA_PIN
|
||||
int "I2C3 sda pin number"
|
||||
range 1 176
|
||||
default 33
|
||||
endif
|
||||
endif
|
||||
|
||||
config BSP_USING_ONCHIP_RTC
|
||||
bool "Enable RTC"
|
||||
select RT_USING_RTC
|
||||
select RT_USING_LIBC
|
||||
default n
|
||||
|
||||
endmenu
|
||||
|
||||
@@ -16,10 +16,12 @@ void SystemClock_Config(void)
|
||||
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
|
||||
RCC_PeriphCLKInitTypeDef PeriphClkInit = {0};
|
||||
|
||||
#ifdef BSP_USING_ONCHIP_RTC
|
||||
/**Configure LSE Drive Capability
|
||||
*/
|
||||
HAL_PWR_EnableBkUpAccess();
|
||||
__HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW);
|
||||
#endif
|
||||
/**Initializes the CPU, AHB and APB busses clocks
|
||||
*/
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
|
||||
|
||||
+2324
-2271
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -78,9 +78,7 @@
|
||||
#define RT_PIPE_BUFSZ 512
|
||||
#define RT_USING_SERIAL
|
||||
#define RT_SERIAL_USING_DMA
|
||||
#define RT_SERIAL_RB_BUFSZ 64
|
||||
#define RT_USING_PIN
|
||||
#define RT_USING_RTC
|
||||
|
||||
/* Using WiFi */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user