[NUC472] Fix warnings generated by armcc

pull/2861/head
ccli8 2016-09-19 17:17:21 +08:00
parent dfc32409a9
commit a9d65e46a3
5 changed files with 21 additions and 21 deletions

View File

@ -24,12 +24,12 @@
#define NVIC_NUM_VECTORS (NVIC_USER_IRQ_OFFSET + NVIC_USER_IRQ_NUMBER)
#if defined(__CC_ARM)
# define NVIC_RAM_VECTOR_ADDRESS &Image$$ER_IRAMVEC$$ZI$$Base
# define NVIC_RAM_VECTOR_ADDRESS ((uint32_t) &Image$$ER_IRAMVEC$$ZI$$Base)
#elif defined(__ICCARM__)
# pragma section = "IRAMVEC"
# define NVIC_RAM_VECTOR_ADDRESS ((uint32_t) __section_begin("IRAMVEC"))
#elif defined(__GNUC__)
# define NVIC_RAM_VECTOR_ADDRESS &__start_vector_table__
# define NVIC_RAM_VECTOR_ADDRESS ((uint32_t) &__start_vector_table__)
#endif

View File

@ -11,6 +11,14 @@
#include "NUC472_442.h"
/* Suppress warning messages */
#if defined(__CC_ARM)
// Suppress warning message: extended constant initialiser used
#pragma diag_suppress 1296
#elif defined(__ICCARM__)
#elif defined(__GNUC__)
#endif
/* Macro Definitions */
#if defined(__CC_ARM)
#define WEAK __attribute__ ((weak))
@ -238,12 +246,12 @@ const uint32_t __vector_handlers[] = {
/* Configure Initial Stack Pointer, using linker-generated symbols */
#if defined(__CC_ARM)
&Image$$ARM_LIB_STACK$$ZI$$Limit,
(uint32_t) &Image$$ARM_LIB_STACK$$ZI$$Limit,
#elif defined(__ICCARM__)
//(uint32_t) __sfe("CSTACK"),
(uint32_t) &CSTACK$$Limit,
#elif defined(__GNUC__)
&__StackTop,
(uint32_t) &__StackTop,
#endif
(uint32_t) Reset_Handler, // Reset Handler

View File

@ -58,7 +58,7 @@ void SystemCoreClockUpdate (void) /* Get Core Clock Frequency */
*/
void SystemInit (void)
{
uint32_t u32RTC_EN_Flag = 0;
//uint32_t u32RTC_EN_Flag = 0;
/* FPU settings ------------------------------------------------------------*/
#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)

View File

@ -93,8 +93,8 @@ static int i2c_do_trsn(i2c_t *obj, uint32_t i2c_ctl, int sync);
#define NU_I2C_TIMEOUT_STOP 500000
static int i2c_poll_status_timeout(i2c_t *obj, int (*is_status)(i2c_t *obj), uint32_t timeout);
static int i2c_poll_tran_heatbeat_timeout(i2c_t *obj, uint32_t timeout);
static int i2c_is_stat_int(i2c_t *obj);
static int i2c_is_stop_det(i2c_t *obj);
//static int i2c_is_stat_int(i2c_t *obj);
//static int i2c_is_stop_det(i2c_t *obj);
static int i2c_is_trsn_done(i2c_t *obj);
static int i2c_is_tran_started(i2c_t *obj);
static int i2c_addr2data(int address, int read);
@ -115,6 +115,8 @@ static void i2c_rollback_vector_interrupt(i2c_t *obj);
#define TRANCTRL_STARTED (1)
#define TRANCTRL_NAKLASTDATA (1 << 1)
uint32_t us_ticker_read(void);
void i2c_init(i2c_t *obj, PinName sda, PinName scl)
{
uint32_t i2c_sda = pinmap_peripheral(sda, PinMap_I2C_SDA);
@ -178,8 +180,6 @@ void i2c_frequency(i2c_t *obj, int hz)
int i2c_read(i2c_t *obj, int address, char *data, int length, int stop)
{
int i;
if (i2c_start(obj)) {
i2c_stop(obj);
return I2C_ERROR_BUS_BUSY;
@ -203,8 +203,6 @@ int i2c_read(i2c_t *obj, int address, char *data, int length, int stop)
int i2c_write(i2c_t *obj, int address, const char *data, int length, int stop)
{
int i;
if (i2c_start(obj)) {
i2c_stop(obj);
return I2C_ERROR_BUS_BUSY;
@ -306,7 +304,6 @@ static int i2c_addr2bspaddr(int address)
static void i2c_enable_int(i2c_t *obj)
{
I2C_T *i2c_base = (I2C_T *) NU_MODBASE(obj->i2c.i2c);
const struct nu_modinit_s *modinit = get_modinit(obj->i2c.i2c, i2c_modinit_tab);
core_util_critical_section_enter();
@ -320,7 +317,6 @@ static void i2c_enable_int(i2c_t *obj)
static void i2c_disable_int(i2c_t *obj)
{
I2C_T *i2c_base = (I2C_T *) NU_MODBASE(obj->i2c.i2c);
const struct nu_modinit_s *modinit = get_modinit(obj->i2c.i2c, i2c_modinit_tab);
core_util_critical_section_enter();
@ -334,7 +330,6 @@ static void i2c_disable_int(i2c_t *obj)
static int i2c_set_int(i2c_t *obj, int inten)
{
I2C_T *i2c_base = (I2C_T *) NU_MODBASE(obj->i2c.i2c);
int inten_back;
core_util_critical_section_enter();
@ -374,8 +369,6 @@ int i2c_allow_powerdown(void)
static int i2c_do_tran(i2c_t *obj, char *buf, int length, int read, int naklastdata)
{
I2C_T *i2c_base = (I2C_T *) NU_MODBASE(obj->i2c.i2c);
int err = 0;
int tran_len = 0;
i2c_disable_int(obj);
@ -386,7 +379,6 @@ static int i2c_do_tran(i2c_t *obj, char *buf, int length, int read, int naklastd
i2c_enable_int(obj);
if (i2c_poll_tran_heatbeat_timeout(obj, NU_I2C_TIMEOUT_STAT_INT)) {
err = I2C_ERROR_BUS_BUSY;
#if NU_I2C_DEBUG
MY_I2C_2 = obj->i2c;
while (1);
@ -502,7 +494,6 @@ static int i2c_poll_status_timeout(i2c_t *obj, int (*is_status)(i2c_t *obj), uin
static int i2c_poll_tran_heatbeat_timeout(i2c_t *obj, uint32_t timeout)
{
uint32_t t1, t2, elapsed = 0;
I2C_T *i2c_base = (I2C_T *) NU_MODBASE(obj->i2c.i2c);
int tran_started;
char *tran_pos = NULL;
char *tran_pos2 = NULL;
@ -547,6 +538,7 @@ static int i2c_poll_tran_heatbeat_timeout(i2c_t *obj, uint32_t timeout)
return (elapsed >= timeout);
}
#if 0
static int i2c_is_stat_int(i2c_t *obj)
{
I2C_T *i2c_base = (I2C_T *) NU_MODBASE(obj->i2c.i2c);
@ -554,12 +546,14 @@ static int i2c_is_stat_int(i2c_t *obj)
return !! (i2c_base->CTL & I2C_CTL_SI_Msk);
}
static int i2c_is_stop_det(i2c_t *obj)
{
I2C_T *i2c_base = (I2C_T *) NU_MODBASE(obj->i2c.i2c);
return ! (i2c_base->CTL & I2C_CTL_STO_Msk);
}
#endif
static int i2c_is_trsn_done(i2c_t *obj)
{
@ -578,7 +572,6 @@ static int i2c_is_trsn_done(i2c_t *obj)
static int i2c_is_tran_started(i2c_t *obj)
{
I2C_T *i2c_base = (I2C_T *) NU_MODBASE(obj->i2c.i2c);
int started;
int inten_back;
@ -619,7 +612,6 @@ static void i2c_irq(i2c_t *obj)
{
I2C_T *i2c_base = (I2C_T *) NU_MODBASE(obj->i2c.i2c);
uint32_t status;
int data_recv = 0;
if (I2C_GET_TIMEOUT_FLAG(i2c_base)) {
I2C_ClearTimeoutFlag(i2c_base);

View File

@ -116,7 +116,7 @@ void spi_init(spi_t *obj, PinName mosi, PinName miso, PinName sclk, PinName ssel
// Enable IP clock
CLK_EnableModuleClock(modinit->clkidx);
SPI_T *spi_base = (SPI_T *) NU_MODBASE(obj->spi.spi);
//SPI_T *spi_base = (SPI_T *) NU_MODBASE(obj->spi.spi);
pinmap_pinout(mosi, PinMap_SPI_MOSI);
pinmap_pinout(miso, PinMap_SPI_MISO);