From 96b1da173edb42aab35d65cbd27ba982ce278a70 Mon Sep 17 00:00:00 2001
From: lin <429426691@qq.com>
Date: Wed, 20 Sep 2017 12:42:23 +0800
Subject: [PATCH] Modified not use c99
---
bsp/apollo2/board/uart.c | 13 +++---
.../libraries/drivers/hal/am_hal_cachectrl.c | 24 +++++------
bsp/apollo2/project.uvprojx | 40 ++++++++++++-------
bsp/apollo2/template.uvprojx | 6 +--
4 files changed, 47 insertions(+), 36 deletions(-)
diff --git a/bsp/apollo2/board/uart.c b/bsp/apollo2/board/uart.c
index 80a8f98d1d..3a9242ab55 100644
--- a/bsp/apollo2/board/uart.c
+++ b/bsp/apollo2/board/uart.c
@@ -55,11 +55,11 @@ struct am_uart
*/
am_hal_uart_config_t g_sUartConfig =
{
- .ui32BaudRate = 115200,
- .ui32DataBits = AM_HAL_UART_DATA_BITS_8,
- .bTwoStopBits = false,
- .ui32Parity = AM_HAL_UART_PARITY_NONE,
- .ui32FlowCtrl = AM_HAL_UART_FLOW_CTRL_NONE,
+ 115200, // ui32BaudRate
+ AM_HAL_UART_DATA_BITS_8, // ui32DataBits
+ false, // bTwoStopBits
+ AM_HAL_UART_PARITY_NONE, // ui32Parity
+ AM_HAL_UART_FLOW_CTRL_NONE, // ui32FlowCtrl
};
/**
@@ -246,9 +246,10 @@ static int am_getc(struct rt_serial_device *serial)
static void uart_isr(struct rt_serial_device *serial)
{
uint32_t status;
+ struct am_uart* uart;
RT_ASSERT(serial != RT_NULL);
- struct am_uart *uart = (struct am_uart *) serial->parent.user_data;
+ uart = (struct am_uart *) serial->parent.user_data;
RT_ASSERT(uart != RT_NULL);
diff --git a/bsp/apollo2/libraries/drivers/hal/am_hal_cachectrl.c b/bsp/apollo2/libraries/drivers/hal/am_hal_cachectrl.c
index 23c7164418..26c41a22e3 100644
--- a/bsp/apollo2/libraries/drivers/hal/am_hal_cachectrl.c
+++ b/bsp/apollo2/libraries/drivers/hal/am_hal_cachectrl.c
@@ -57,18 +57,18 @@
//*****************************************************************************
const am_hal_cachectrl_config_t am_hal_cachectrl_defaults =
{
- .ui32EnableCache = 1,
- .ui32LRU = 0,
- .ui32EnableNCregions = 0,
- .ui32Config = AM_HAL_CACHECTRL_CACHECFG_CONFIG_2WAY_512,
- .ui32SerialCacheMode = 0,
- .ui32FlashCachingEnables = 3,
- .ui32EnableCacheClockGating = 1,
- .ui32EnableLightSleep = 0,
- .ui32Dly = 1,
- .ui32SMDly = 1,
- .ui32EnableDataClockGating = 1,
- .ui32EnableCacheMonitoring = 0,
+ 1, // ui32EnableCache
+ 0, // ui32LRU
+ 0, // ui32EnableNCregions
+ AM_HAL_CACHECTRL_CACHECFG_CONFIG_2WAY_512, // ui32Config
+ 0, // ui32SerialCacheMode
+ 3, // ui32FlashCachingEnables
+ 1, // ui32EnableCacheClockGating
+ 0, // ui32EnableLightSleep
+ 1, // ui32Dly
+ 1, // ui32SMDly
+ 1, // ui32EnableDataClockGating
+ 0, // ui32EnableCacheMonitoring
};
//*****************************************************************************
diff --git a/bsp/apollo2/project.uvprojx b/bsp/apollo2/project.uvprojx
index 6e5bcba4b4..a528b27b90 100644
--- a/bsp/apollo2/project.uvprojx
+++ b/bsp/apollo2/project.uvprojx
@@ -79,7 +79,7 @@
0
- 0
+ 1
0
fromelf --bin !L --output rtthread.bin
@@ -354,7 +354,7 @@
1
0
0
- 1
+ 0
0
0
0
@@ -363,7 +363,7 @@
2
0
0
- 1
+ 0
0
1
1
@@ -373,7 +373,7 @@
AM_PART_APOLLO2, AM_PACKAGE_BGA, keil
- applications;.;board;libraries\drivers;libraries\startup;..\..\include;..\..\libcpu\arm\cortex-m4;..\..\libcpu\arm\common;..\..\components\drivers\include;..\..\components\drivers\include;..\..\components\finsh
+ applications;.;board;libraries\drivers;libraries\startup;..\..\include;..\..\libcpu\arm\cortex-m4;..\..\libcpu\arm\common;..\..\components\drivers\include;..\..\components\drivers\include;..\..\components\drivers\include;..\..\components\finsh
@@ -417,34 +417,39 @@
Applications
- application.c
+ main.c
1
- applications\application.c
-
-
- startup.c
- 1
- applications\startup.c
+ applications\main.c
Board
+
+ adc.c
+ 1
+ board\adc.c
+
board.c
1
board\board.c
- hw_led.c
+ gpio.c
1
- board\hw_led.c
+ board\gpio.c
- hw_uart.c
+ led.c
1
- board\hw_uart.c
+ board\led.c
+
+
+ uart.c
+ 1
+ board\uart.c
@@ -626,6 +631,11 @@
DeviceDrivers
+
+ pin.c
+ 1
+ ..\..\components\drivers\misc\pin.c
+
serial.c
1
diff --git a/bsp/apollo2/template.uvprojx b/bsp/apollo2/template.uvprojx
index eef72b7995..29ce82bf53 100644
--- a/bsp/apollo2/template.uvprojx
+++ b/bsp/apollo2/template.uvprojx
@@ -79,7 +79,7 @@
0
- 0
+ 1
0
fromelf --bin !L --output rtthread.bin
@@ -354,7 +354,7 @@
1
0
0
- 1
+ 0
0
0
0
@@ -363,7 +363,7 @@
2
0
0
- 1
+ 0
0
1
1