提交 3e6b8669 编写于 作者: Thomas_Fly's avatar Thomas_Fly

fix the code sytle

上级 6c7ae389
...@@ -27,8 +27,8 @@ static struct mcu_drv_spi_config spi_config[] = ...@@ -27,8 +27,8 @@ static struct mcu_drv_spi_config spi_config[] =
#endif #endif
#ifdef BSP_USING_SPI1 #ifdef BSP_USING_SPI1
MCU_SPI1_CONFIG, MCU_SPI1_CONFIG,
#endif #endif
}; };
static struct mcu_drv_spi spi_bus_obj[sizeof(spi_config) / sizeof(spi_config[0])]; static struct mcu_drv_spi spi_bus_obj[sizeof(spi_config) / sizeof(spi_config[0])];
...@@ -169,7 +169,7 @@ rt_err_t rt_hw_spi_device_attach(const char *bus_name, const char *device_name, ...@@ -169,7 +169,7 @@ rt_err_t rt_hw_spi_device_attach(const char *bus_name, const char *device_name,
#define SPI_DEVICE_BUS "spi0" #define SPI_DEVICE_BUS "spi0"
#define SPI_DEVICE_NAME "spi01" #define SPI_DEVICE_NAME "spi01"
#define TEST_LEN 10 #define TEST_LEN 10
uint8_t rx_data[TEST_LEN]; uint8_t rx_data[TEST_LEN];
uint8_t tx_data[TEST_LEN]; uint8_t tx_data[TEST_LEN];
...@@ -177,7 +177,7 @@ static void spi_sample(int argc, char *argv[]) ...@@ -177,7 +177,7 @@ static void spi_sample(int argc, char *argv[])
{ {
struct rt_spi_device *spi_dev; struct rt_spi_device *spi_dev;
char name[RT_NAME_MAX]; char name[RT_NAME_MAX];
rt_kprintf("\n************** SPI Loopback Demo ****************\n"); rt_kprintf("\n************** SPI Loopback Demo ****************\n");
rt_kprintf("This example configures the SPI to send data between the MISO (P0.4) and\n"); rt_kprintf("This example configures the SPI to send data between the MISO (P0.4) and\n");
rt_kprintf("MOSI (P0.5) pins. Connect these two pins together. \n"); rt_kprintf("MOSI (P0.5) pins. Connect these two pins together. \n");
......
...@@ -36,24 +36,20 @@ rt_err_t rt_hw_spi_device_attach(const char *bus_name, const char *device_name, ...@@ -36,24 +36,20 @@ rt_err_t rt_hw_spi_device_attach(const char *bus_name, const char *device_name,
#endif #endif
#ifdef BSP_USING_SPI1 #ifdef BSP_USING_SPI1
#ifdef BSP_USING_SPI1A //The SPI1A is conflit with UART1 TX RX P0.10 P0.11 #ifdef BSP_USING_SPI1A //The SPI1A is conflit with UART1 TX RX P0.10 P0.11
#define MCU_SPI1_CONFIG \ #define MCU_SPI1_CONFIG \
{ \ { \
.bus_name = "spi1", \ .bus_name = "spi1", \
.spi_instance = SPI1A \ .spi_instance = SPI1A \
} }
#else #else
#define MCU_SPI1_CONFIG \ #define MCU_SPI1_CONFIG \
{ \ { \
.bus_name = "spi1", \ .bus_name = "spi1", \
.spi_instance = SPI1B \ .spi_instance = SPI1B \
} }
#endif #endif
//TODO LIST SPI1A SPI1B
#endif #endif
struct mcu_drv_spi_config struct mcu_drv_spi_config
{ {
char *bus_name; char *bus_name;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册