Skip to content

Commit 884fe43

Browse files
authored
Merge pull request ARMmbed#107 from linlingao/fix_warnings
Remove compiler warnings
2 parents 554b125 + 240c0c8 commit 884fe43

File tree

11 files changed

+39
-19
lines changed

11 files changed

+39
-19
lines changed

rtos/TARGET_CORTEX/rtx5/RTX/Source/rtx_core_cm.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,14 @@
3333

3434
#include <stdbool.h>
3535
typedef bool bool_t;
36+
37+
#ifndef FALSE
3638
#define FALSE (0)
39+
#endif
40+
41+
#ifndef TRUE
3742
#define TRUE (1)
43+
#endif
3844

3945
#ifdef RTE_CMSIS_RTOS2_RTX5_ARMV8M_NS
4046
#define DOMAIN_NS 1

targets/TARGET_TI/TARGET_CC32XX/TARGET_CC3220SF/gpio_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ void gpio_init(gpio_t *obj, PinName pin)
4545
obj->pin_mask = 1<<(pinmap_find_function(pin, PinMap_GPIO)%8);
4646

4747
// determine PRCM GPIO CLOCK index
48-
unsigned short prcm_peripheral;
48+
unsigned short prcm_peripheral = 0;
4949
switch (gpio_base)
5050
{
5151
case CC3220SF_GPIOA0_BASE:

targets/TARGET_TI/TARGET_CC32XX/TARGET_CC3220SF/gpio_irq_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ int gpio_irq_init(gpio_irq_t *obj, PinName pin, gpio_irq_handler handler, uint32
110110
obj->ch = ch_num;
111111
obj->pin_mask = 1<<(ch_num%8);
112112
irq_handler = handler;
113-
uint32_t vector;
113+
uint32_t vector = (uint32_t)gpio_irqA0;
114114
switch (gpio_base)
115115
{
116116
case CC3220SF_GPIOA0_BASE:

targets/TARGET_TI/TARGET_CC32XX/TARGET_CC3220SF/port_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const uint16_t PortPinTypes[] = {
4848
PIN_TYPE_OD, /* GPIO_CFG_OUT_OD_NOPULL */
4949
PIN_TYPE_OD_PU, /* GPIO_CFG_OUT_OD_PU */
5050
PIN_TYPE_OD_PD, /* GPIO_CFG_OUT_OD_PD */
51-
PIN_TYPE_ANALOG
51+
(uint16_t)PIN_TYPE_ANALOG // Revisit this, PIN_TYPE_ANALOG gets truncated to 16b
5252
};
5353

5454
PinName port_pin(PortName port, int pin_n) {

targets/TARGET_TI/TARGET_CC32XX/TARGET_CC3220SF/pwmout_api.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ static const uint32_t timerHalves[2] = {
4242
TIMER_B,
4343
};
4444

45-
static const uint32_t gpioBaseAddresses[4] = {
45+
/*static const uint32_t gpioBaseAddresses[4] = {
4646
CC3220SF_GPIOA0_BASE,
4747
CC3220SF_GPIOA1_BASE,
4848
CC3220SF_GPIOA2_BASE,
4949
CC3220SF_GPIOA3_BASE,
50-
};
50+
};*/
5151

52-
static const uint32_t gpioPinIndexes[8] = {
52+
/*static const uint32_t gpioPinIndexes[8] = {
5353
GPIO_PIN_0,
5454
GPIO_PIN_1,
5555
GPIO_PIN_2,
@@ -58,7 +58,7 @@ static const uint32_t gpioPinIndexes[8] = {
5858
GPIO_PIN_5,
5959
GPIO_PIN_6,
6060
GPIO_PIN_7,
61-
};
61+
};*/
6262

6363
#define PinConfigTimerPort(config) (((config) >> 28) & 0xF)
6464
#define PinConfigTimerHalf(config) (((config) >> 24) & 0xF)
@@ -91,7 +91,7 @@ static const uint32_t gpioPinIndexes[8] = {
9191
#define PWMTimerCC32XX_PIN_21 (PWMTimerCC32XX_T1A | PWMTimerCC32XX_GPIO25 | 0x0914)
9292
#define PWMTimerCC32XX_PIN_64 (PWMTimerCC32XX_T2B | PWMTimerCC32XX_GPIO9 | 0x033F)
9393

94-
static unsigned int pwm_clock_mhz;
94+
//static unsigned int pwm_clock_mhz;
9595

9696
void pwmout_init(pwmout_t* obj, PinName pin) {
9797
PWMName pwm = (PWMName)pinmap_peripheral(pin, PinMap_PWM);
@@ -105,6 +105,7 @@ void pwmout_init(pwmout_t* obj, PinName pin) {
105105
case PIN_19: obj->pwmPin = PWMTimerCC32XX_PIN_19; break;
106106
case PIN_21: obj->pwmPin = PWMTimerCC32XX_PIN_21; break;
107107
case PIN_64: obj->pwmPin = PWMTimerCC32XX_PIN_64; break;
108+
default: break;
108109
}
109110

110111
uint32_t timerBaseAddr = timerBaseAddresses[PinConfigTimerPort(obj->pwmPin)];

targets/TARGET_TI/TARGET_CC32XX/TARGET_CC3220SF/serial_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,11 +324,11 @@ void serial_irq_set(serial_t *obj, SerialIrq irq, uint32_t enable)
324324
serial_irq_set_internal(obj, irq, enable);
325325
}
326326

327-
static void serial_flow_irq_set(serial_t *obj, uint32_t enable)
327+
/*static void serial_flow_irq_set(serial_t *obj, uint32_t enable)
328328
{
329329
uart_data[obj->index].rx_irq_set_flow = enable;
330330
serial_irq_set_internal(obj, RxIrq, enable);
331-
}
331+
}*/
332332

333333
/******************************************************************************
334334
* READ/WRITE

targets/TARGET_TI/TARGET_CC32XX/TARGET_CC3220SF/ti/drivers/dpl/MutexP.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ uintptr_t MutexP_lock(MutexP_Handle handle)
6565
Mutex * p_mutex = ( Mutex *)handle;
6666

6767
/* Try 1 millisecond */
68-
while(p_mutex->lock(1) != osOK);
68+
while(p_mutex->trylock_for(1) == false);
6969
return (0);
7070
}
7171

targets/TARGET_TI/TARGET_CC32XX/TARGET_CC3220SF/ti/drivers/dpl/PowerCC32XX_mbed.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,13 @@
5757
#define COUNT_WITHIN_TRESHOLD(a, b, c, th) \
5858
((((b) - (a)) <= (th)) ? (b) : (c))
5959

60+
#ifndef TRUE
6061
#define TRUE 1
62+
#endif
63+
64+
#ifndef FALSE
6165
#define FALSE 0
66+
#endif
6267

6368

6469
static volatile uint32_t idleTime = 0;

targets/TARGET_TI/TARGET_CC32XX/TARGET_CC3220SF/ti/drivers/net/wifi/porting/cc_pal.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,5 +492,5 @@ void NwpWaitForShutDownInd()
492492

493493
void* pthread_self(void)
494494
{
495-
return Thread::gettid();
495+
return ThisThread::get_id();
496496
}

targets/TARGET_TI/TARGET_CC32XX/TARGET_CC3220SF/ti/drivers/net/wifi/source/fs.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,9 @@ _i32 sl_FsProgram(const _u8* pData , _u16 DataLen ,const _u8 * pKey , _u32 F
714714
}
715715
else if( (DataLen> 0) && ( pData == NULL))
716716
{
717-
return( ((_i32)SL_ERROR_FS_WRONG_INPUT_SIZE) << 16 );
717+
//return( ((_i32)SL_ERROR_FS_WRONG_INPUT_SIZE) << 16 );
718+
// Remove warning
719+
return (_i16)( ((_u32)SL_ERROR_FS_WRONG_INPUT_SIZE) << 16 );
718720
}
719721
else if( (DataLen == 0) && (pKey != NULL) )
720722
{
@@ -729,7 +731,7 @@ _i32 sl_FsProgram(const _u8* pData , _u16 DataLen ,const _u8 * pKey , _u32 F
729731
{
730732
if( (DataLen & 0xF) > 0)
731733
{
732-
return( ((_i32)SL_ERROR_FS_NOT_16_ALIGNED) << 16 );
734+
return (_i32)(((_u32)SL_ERROR_FS_NOT_16_ALIGNED) << 16 );
733735
}
734736
Msg.Cmd.Flags = Flags;
735737

targets/TARGET_TI/TARGET_CC32XX/TARGET_CC3220SF/ti/drivers/power/PowerCC32XX.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,14 @@
7373
#include <ti/devices/cc32xx/driverlib/hwspinlock.h>
7474
#include <ti/devices/cc32xx/driverlib/ti_spi_driverlib.h>
7575

76+
#ifndef TRUE
7677
#define TRUE 1
78+
#endif
79+
80+
#ifndef FALSE
7781
#define FALSE 0
82+
#endif
83+
7884
#define STATUS_BUSY 0x01
7985

8086
#define PowerCC32XX_SSPIReadStatusInstruction (0x05)
@@ -625,12 +631,12 @@ int_fast16_t Power_shutdown(uint_fast16_t shutdownState,
625631
int_fast16_t Power_sleep(uint_fast16_t sleepState)
626632
{
627633
int_fast16_t status = Power_SOK;
628-
uint32_t romMajorVer;
629-
uint32_t romMinorVer;
634+
//uint32_t romMajorVer;
635+
//uint32_t romMinorVer;
630636
uint32_t preEvent;
631637
uint32_t postEvent;
632638
uint32_t semBits;
633-
bool earlyPG = true;
639+
//bool earlyPG = true;
634640

635641
/* first validate the sleep state */
636642
if (sleepState != PowerCC32XX_LPDS) {
@@ -678,11 +684,11 @@ int_fast16_t Power_sleep(uint_fast16_t sleepState)
678684
saveNVICRegs();
679685

680686
/* check if PG >= 2.01 */
681-
romMajorVer = HWREG(0x00000400) & 0xFFFF;
687+
/*romMajorVer = HWREG(0x00000400) & 0xFFFF;
682688
romMinorVer = HWREG(0x00000400) >> 16;
683689
if ((romMajorVer >= 3) || ((romMajorVer == 2) && (romMinorVer >= 1))) {
684690
earlyPG = false;
685-
}
691+
}*/
686692

687693
/* call sync barrier */
688694
SYNCBARRIER();

0 commit comments

Comments
 (0)