Skip to content

Commit 48d12c3

Browse files
committed
FUTURE_SEQUANA: Fixed ARMC6 compiler errors and warnings
1 parent 270f368 commit 48d12c3

File tree

11 files changed

+57
-22
lines changed

11 files changed

+57
-22
lines changed

targets/TARGET_Cypress/TARGET_PSOC6_FUTURE/TARGET_CY8C63XX/TARGET_MCU_PSOC6_M4/system_psoc63_cm4.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ void Cy_SystemInitFpuEnable(void)
409409
* linker configuration files. The following symbols used by the cymcuelftool.
410410
*
411411
*******************************************************************************/
412-
#if defined (__ARMCC_VERSION)
412+
#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION < 6000000)
413413
__asm void Cy_MemorySymbols(void)
414414
{
415415
/* Flash */

targets/TARGET_Cypress/TARGET_PSOC6_FUTURE/device/drivers/include/cy_ctdac.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -922,10 +922,12 @@ __STATIC_INLINE uint32_t Cy_CTDAC_GetInterruptStatus(const CTDAC_Type *base)
922922
*******************************************************************************/
923923
__STATIC_INLINE void Cy_CTDAC_ClearInterrupt(CTDAC_Type *base)
924924
{
925+
uint32_t unused;
926+
925927
base->INTR = CTDAC_INTR_VDAC_EMPTY_Msk;
926928

927929
/* Dummy read for buffered writes. */
928-
(void) base->INTR;
930+
unused = base->INTR;
929931
}
930932

931933
/*******************************************************************************

targets/TARGET_Cypress/TARGET_PSOC6_FUTURE/device/drivers/include/cy_gpio.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,15 +1566,17 @@ __STATIC_INLINE uint32_t Cy_GPIO_GetInterruptStatus(GPIO_PRT_Type* base, uint32_
15661566
*******************************************************************************/
15671567
__STATIC_INLINE void Cy_GPIO_ClearInterrupt(GPIO_PRT_Type* base, uint32_t pinNum)
15681568
{
1569+
uint32_t unused;
1570+
15691571
CY_ASSERT_L2(CY_GPIO_IS_FILTER_PIN_VALID(pinNum));
15701572

15711573
/* Any INTR MMIO registers AHB clearing must be preceded with an AHB read access */
1572-
(void)base->INTR;
1574+
unused = base->INTR;
15731575

15741576
base->INTR = CY_GPIO_INTR_STATUS_MASK << pinNum;
15751577

15761578
/* This read ensures that the initial write has been flushed out to the hardware */
1577-
(void)base->INTR;
1579+
unused = base->INTR;
15781580
}
15791581

15801582

targets/TARGET_Cypress/TARGET_PSOC6_FUTURE/device/drivers/include/cy_ipc_drv.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,11 +615,13 @@ __STATIC_INLINE void Cy_IPC_Drv_SetInterrupt(IPC_INTR_STRUCT_Type* base, uint32
615615
*******************************************************************************/
616616
__STATIC_INLINE void Cy_IPC_Drv_ClearInterrupt(IPC_INTR_STRUCT_Type* base, uint32_t ipcReleaseMask, uint32_t ipcNotifyMask)
617617
{
618+
uint32_t unused;
619+
618620
CY_ASSERT_L1(0ul == (ipcNotifyMask & ~(uint32_t)(IPC_STRUCT_NOTIFY_INTR_NOTIFY_Msk)));
619621
CY_ASSERT_L1(0ul == (ipcReleaseMask & ~(uint32_t)(IPC_STRUCT_RELEASE_INTR_RELEASE_Msk)));
620622
base->INTR = _VAL2FLD(IPC_INTR_STRUCT_INTR_NOTIFY, ipcNotifyMask) |
621623
_VAL2FLD(IPC_INTR_STRUCT_INTR_RELEASE, ipcReleaseMask);
622-
(void)base->INTR; /* Read the register to flush the cache */
624+
unused = base->INTR; /* Read the register to flush the cache */
623625
}
624626

625627
/** \} group_ipc_functions */

targets/TARGET_Cypress/TARGET_PSOC6_FUTURE/device/drivers/include/cy_sar.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1556,12 +1556,14 @@ __STATIC_INLINE uint32_t Cy_SAR_GetInterruptStatus(const SAR_Type *base)
15561556
*******************************************************************************/
15571557
__STATIC_INLINE void Cy_SAR_ClearInterrupt(SAR_Type *base, uint32_t intrMask)
15581558
{
1559+
uint32_t unused;
1560+
15591561
CY_ASSERT_L2(CY_SAR_INTRMASK(intrMask));
15601562

15611563
base->INTR = intrMask;
15621564

15631565
/* Dummy read for buffered writes. */
1564-
(void) base->INTR;
1566+
unused = base->INTR;
15651567
}
15661568

15671569
/*******************************************************************************
@@ -1710,12 +1712,14 @@ __STATIC_INLINE uint32_t Cy_SAR_GetRangeInterruptStatus(const SAR_Type *base)
17101712
*******************************************************************************/
17111713
__STATIC_INLINE void Cy_SAR_ClearRangeInterrupt(SAR_Type *base, uint32_t chanMask)
17121714
{
1715+
uint32_t unused;
1716+
17131717
CY_ASSERT_L2(CY_SAR_CHANMASK(chanMask));
17141718

17151719
base->RANGE_INTR = chanMask;
17161720

17171721
/* Dummy read for buffered writes. */
1718-
(void) base->RANGE_INTR;
1722+
unused = base->RANGE_INTR;
17191723
}
17201724

17211725
/*******************************************************************************
@@ -1851,12 +1855,14 @@ __STATIC_INLINE uint32_t Cy_SAR_GetSatInterruptStatus(const SAR_Type *base)
18511855
*******************************************************************************/
18521856
__STATIC_INLINE void Cy_SAR_ClearSatInterrupt(SAR_Type *base, uint32_t chanMask)
18531857
{
1858+
uint32_t unused;
1859+
18541860
CY_ASSERT_L2(CY_SAR_CHANMASK(chanMask));
18551861

18561862
base->SATURATE_INTR = chanMask;
18571863

18581864
/* Dummy read for buffered writes. */
1859-
(void) base->SATURATE_INTR;
1865+
unused = base->SATURATE_INTR;
18601866
}
18611867

18621868
/*******************************************************************************

targets/TARGET_Cypress/TARGET_PSOC6_FUTURE/device/drivers/include/cy_scb_common.h

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -660,10 +660,12 @@ __STATIC_INLINE uint32_t Cy_SCB_GetRxSrValid(CySCB_Type const *base)
660660
*******************************************************************************/
661661
__STATIC_INLINE void Cy_SCB_ClearRxFifo(CySCB_Type* base)
662662
{
663+
uint32_t unused;
664+
663665
base->RX_FIFO_CTRL |= (uint32_t) SCB_RX_FIFO_CTRL_CLEAR_Msk;
664666
base->RX_FIFO_CTRL &= (uint32_t) ~SCB_RX_FIFO_CTRL_CLEAR_Msk;
665667

666-
(void) base->RX_FIFO_CTRL;
668+
unused = base->RX_FIFO_CTRL;
667669
}
668670

669671

@@ -785,10 +787,12 @@ __STATIC_INLINE bool Cy_SCB_IsTxComplete(CySCB_Type const *base)
785787
*******************************************************************************/
786788
__STATIC_INLINE void Cy_SCB_ClearTxFifo(CySCB_Type *base)
787789
{
790+
uint32_t unused;
791+
788792
base->TX_FIFO_CTRL |= (uint32_t) SCB_TX_FIFO_CTRL_CLEAR_Msk;
789793
base->TX_FIFO_CTRL &= (uint32_t) ~SCB_TX_FIFO_CTRL_CLEAR_Msk;
790794

791-
(void) base->TX_FIFO_CTRL;
795+
unused = base->TX_FIFO_CTRL;
792796
}
793797

794798

@@ -958,10 +962,12 @@ __STATIC_INLINE uint32_t Cy_SCB_GetRxInterruptStatusMasked(CySCB_Type const *bas
958962
*******************************************************************************/
959963
__STATIC_INLINE void Cy_SCB_ClearRxInterrupt(CySCB_Type *base, uint32_t interruptMask)
960964
{
965+
uint32_t unused;
966+
961967
CY_ASSERT_L2(CY_SCB_IS_INTR_VALID(interruptMask, CY_SCB_RX_INTR_MASK));
962968

963969
base->INTR_RX = interruptMask;
964-
(void) base->INTR_RX;
970+
unused = base->INTR_RX;
965971
}
966972

967973

@@ -1104,10 +1110,12 @@ __STATIC_INLINE uint32_t Cy_SCB_GetTxInterruptStatusMasked(CySCB_Type const *bas
11041110
*******************************************************************************/
11051111
__STATIC_INLINE void Cy_SCB_ClearTxInterrupt(CySCB_Type *base, uint32_t interruptMask)
11061112
{
1113+
uint32_t unused;
1114+
11071115
CY_ASSERT_L2(CY_SCB_IS_INTR_VALID(interruptMask, CY_SCB_TX_INTR_MASK));
11081116

11091117
base->INTR_TX = interruptMask;
1110-
(void) base->INTR_TX;
1118+
unused = base->INTR_TX;
11111119
}
11121120

11131121

@@ -1241,10 +1249,12 @@ __STATIC_INLINE uint32_t Cy_SCB_GetMasterInterruptStatusMasked(CySCB_Type const
12411249
*******************************************************************************/
12421250
__STATIC_INLINE void Cy_SCB_ClearMasterInterrupt(CySCB_Type *base, uint32_t interruptMask)
12431251
{
1252+
uint32_t unused;
1253+
12441254
CY_ASSERT_L2(CY_SCB_IS_INTR_VALID(interruptMask, CY_SCB_MASTER_INTR_MASK));
12451255

12461256
base->INTR_M = interruptMask;
1247-
(void) base->INTR_M;
1257+
unused = base->INTR_M;
12481258
}
12491259

12501260

@@ -1380,10 +1390,12 @@ __STATIC_INLINE uint32_t Cy_SCB_GetSlaveInterruptStatusMasked(CySCB_Type const *
13801390
*******************************************************************************/
13811391
__STATIC_INLINE void Cy_SCB_ClearSlaveInterrupt(CySCB_Type *base, uint32_t interruptMask)
13821392
{
1393+
uint32_t unused;
1394+
13831395
CY_ASSERT_L2(CY_SCB_IS_INTR_VALID(interruptMask, CY_SCB_SLAVE_INTR_MASK));
13841396

13851397
base->INTR_S = interruptMask;
1386-
(void) base->INTR_S;
1398+
unused = base->INTR_S;
13871399
}
13881400

13891401

@@ -1516,10 +1528,12 @@ __STATIC_INLINE uint32_t Cy_SCB_GetI2CInterruptStatusMasked(CySCB_Type const *ba
15161528
*******************************************************************************/
15171529
__STATIC_INLINE void Cy_SCB_ClearI2CInterrupt(CySCB_Type *base, uint32_t interruptMask)
15181530
{
1531+
uint32_t unused;
1532+
15191533
CY_ASSERT_L2(CY_SCB_IS_INTR_VALID(interruptMask, CY_SCB_I2C_INTR_MASK));
15201534

15211535
base->INTR_I2C_EC = interruptMask;
1522-
(void) base->INTR_I2C_EC;
1536+
unused = base->INTR_I2C_EC;
15231537
}
15241538

15251539

@@ -1629,10 +1643,12 @@ __STATIC_INLINE uint32_t Cy_SCB_GetSpiInterruptStatusMasked(CySCB_Type const *ba
16291643
*******************************************************************************/
16301644
__STATIC_INLINE void Cy_SCB_ClearSpiInterrupt(CySCB_Type *base, uint32_t interruptMask)
16311645
{
1646+
uint32_t unused;
1647+
16321648
CY_ASSERT_L2(CY_SCB_IS_INTR_VALID(interruptMask, CY_SCB_SPI_INTR_MASK));
16331649

16341650
base->INTR_SPI_EC = interruptMask;
1635-
(void) base->INTR_SPI_EC;
1651+
unused = base->INTR_SPI_EC;
16361652
}
16371653

16381654
/** \cond INTERNAL */
@@ -1707,6 +1723,8 @@ __STATIC_INLINE bool Cy_SCB_IsTxDataWidthByte(CySCB_Type const *base)
17071723
*******************************************************************************/
17081724
__STATIC_INLINE void Cy_SCB_FwBlockReset(CySCB_Type *base)
17091725
{
1726+
uint32_t unused;
1727+
17101728
base->CTRL &= (uint32_t) ~SCB_CTRL_ENABLED_Msk;
17111729

17121730
/* Clean-up command registers */
@@ -1715,7 +1733,7 @@ __STATIC_INLINE void Cy_SCB_FwBlockReset(CySCB_Type *base)
17151733

17161734
base->CTRL |= (uint32_t) SCB_CTRL_ENABLED_Msk;
17171735

1718-
(void) base->CTRL;
1736+
unused = base->CTRL;
17191737
}
17201738

17211739

targets/TARGET_Cypress/TARGET_PSOC6_FUTURE/device/drivers/include/cy_sysclk.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2069,6 +2069,8 @@ __STATIC_INLINE cy_en_sysclk_status_t
20692069
Cy_SysClk_PeriphEnableDivider(cy_en_divider_types_t dividerType, uint32_t dividerNum)
20702070
{
20712071
cy_en_sysclk_status_t retval = CY_SYSCLK_BAD_PARAM;
2072+
uint32_t unused;
2073+
20722074
if (dividerType <= CY_SYSCLK_DIV_24_5_BIT)
20732075
{
20742076
if (((dividerType == CY_SYSCLK_DIV_8_BIT) && (dividerNum < PERI_DIV_8_NR)) ||
@@ -2082,7 +2084,7 @@ __STATIC_INLINE cy_en_sysclk_status_t
20822084
PERI_DIV_CMD_PA_DIV_SEL_Msk |
20832085
_VAL2FLD(PERI_DIV_CMD_TYPE_SEL, dividerType) |
20842086
_VAL2FLD(PERI_DIV_CMD_DIV_SEL, dividerNum);
2085-
(void)PERI->DIV_CMD; /* dummy read to handle buffered writes */
2087+
unused = PERI->DIV_CMD; /* dummy read to handle buffered writes */
20862088
retval = CY_SYSCLK_SUCCESS;
20872089
}
20882090
}

targets/TARGET_Cypress/TARGET_PSOC6_FUTURE/device/drivers/include/cy_syslib.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ typedef enum
407407
/*******************************************************************************
408408
* Memory model definitions
409409
*******************************************************************************/
410-
#if defined(__ARMCC_VERSION)
410+
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 6000000)
411411
/** To create cross compiler compatible code, use the CY_NOINIT, CY_SECTION, CY_UNUSED, CY_ALIGN
412412
* attributes at the first place of declaration/definition.
413413
* For example: CY_NOINIT uint32_t noinitVar;

targets/TARGET_Cypress/TARGET_PSOC6_FUTURE/device/drivers/include/cy_tcpwm.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,8 +535,10 @@ __STATIC_INLINE uint32_t Cy_TCPWM_GetInterruptStatus(TCPWM_Type const *base, uin
535535
*******************************************************************************/
536536
__STATIC_INLINE void Cy_TCPWM_ClearInterrupt(TCPWM_Type *base, uint32_t cntNum, uint32_t source)
537537
{
538+
uint32_t unused;
539+
538540
base->CNT[cntNum].INTR = source;
539-
(void)base->CNT[cntNum].INTR;
541+
unused = base->CNT[cntNum].INTR;
540542
}
541543

542544

targets/TARGET_Cypress/TARGET_PSOC6_FUTURE/device/drivers/source/cy_syslib.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
CY_NOINIT cy_stc_fault_frame_t cy_faultFrame;
4848
#endif /* (CY_ARM_FAULT_DEBUG == CY_ARM_FAULT_DEBUG_ENABLED) */
4949

50-
#if defined(__ARMCC_VERSION)
50+
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 6000000)
5151
static __ASM void Cy_SysLib_AsmInfiniteLoop(void) { b . };
5252
#endif /* (__ARMCC_VERSION) */
5353

@@ -500,7 +500,7 @@ void Cy_SysLib_FaultHandler(uint32_t const *faultStackAddr)
500500
*******************************************************************************/
501501
__WEAK void Cy_SysLib_ProcessingFault(void)
502502
{
503-
#if defined(__ARMCC_VERSION)
503+
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 6000000)
504504
/* Assembly implementation of an infinite loop
505505
* is used for the armcc compiler to preserve the call stack.
506506
* Otherwise, the compiler destroys the call stack,

targets/TARGET_Cypress/TARGET_PSOC6_FUTURE/flash_api.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "device.h"
1818
#include "flash_api.h"
1919
#include "cy_flash.h"
20+
#include <string.h>
2021

2122
#if DEVICE_FLASH
2223

0 commit comments

Comments
 (0)