Skip to content

Commit abc65f5

Browse files
authored
Merge pull request #2880 from marshfolx/main
Rename some function parameters to solve -Wshadow issue in SPI and EEPROM libraries
2 parents a8b07e4 + 11aa107 commit abc65f5

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

libraries/EEPROM/src/EEPROM.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ extern "C" {
3636

3737
struct EERef {
3838

39-
EERef(const int index)
40-
: index(index) {}
39+
EERef(const int idx)
40+
: index(idx) {}
4141

4242
//Access/read members.
4343
uint8_t operator*() const
@@ -140,8 +140,8 @@ struct EERef {
140140

141141
struct EEPtr {
142142

143-
EEPtr(const int index)
144-
: index(index) {}
143+
EEPtr(const int idx)
144+
: index(idx) {}
145145

146146
operator int() const
147147
{

libraries/SPI/src/SPI.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,17 @@ extern "C" {
4343

4444
class SPISettings {
4545
public:
46-
constexpr SPISettings(uint32_t clock, BitOrder bitOrder, uint8_t dataMode, SPIDeviceMode deviceMode = SPI_MASTER)
46+
constexpr SPISettings(uint32_t clock, BitOrder order, uint8_t mode, SPIDeviceMode devMode = SPI_MASTER)
4747
: clockFreq(clock),
48-
bitOrder(bitOrder),
49-
dataMode((SPIMode)dataMode),
50-
deviceMode(deviceMode)
48+
bitOrder(order),
49+
dataMode((SPIMode)mode),
50+
deviceMode(devMode)
5151
{ }
52-
constexpr SPISettings(uint32_t clock, BitOrder bitOrder, SPIMode dataMode, SPIDeviceMode deviceMode = SPI_MASTER)
52+
constexpr SPISettings(uint32_t clock, BitOrder order, SPIMode mode, SPIDeviceMode devMode = SPI_MASTER)
5353
: clockFreq(clock),
54-
bitOrder(bitOrder),
55-
dataMode(dataMode),
56-
deviceMode(deviceMode)
54+
bitOrder(order),
55+
dataMode(mode),
56+
deviceMode(devMode)
5757
{ }
5858
constexpr SPISettings()
5959
: clockFreq(SPI_SPEED_CLOCK_DEFAULT),

libraries/SrcWrapper/inc/PortNames.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
extern "C" {
3737
#endif
3838

39-
extern GPIO_TypeDef *GPIOPort[];
39+
extern GPIO_TypeDef *GPIOPort_list[];
4040

4141
typedef enum {
4242
FirstPort = 0x00,
@@ -79,7 +79,7 @@ typedef enum {
7979
#define MAX_NB_PORT (LastPort-FirstPort+1)
8080

8181
/* Return GPIO base address */
82-
#define get_GPIO_Port(p) ((p < MAX_NB_PORT) ? GPIOPort[p] : (GPIO_TypeDef *)NULL)
82+
#define get_GPIO_Port(p) ((p < MAX_NB_PORT) ? GPIOPort_list[p] : (GPIO_TypeDef *)NULL)
8383
/* Enable GPIO clock and return GPIO base address */
8484
GPIO_TypeDef *set_GPIO_Port_Clock(uint32_t port_idx);
8585

libraries/SrcWrapper/src/stm32/PortNames.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
*/
3030
#include "PortNames.h"
3131

32-
GPIO_TypeDef *GPIOPort[MAX_NB_PORT] = {
32+
GPIO_TypeDef *GPIOPort_list[MAX_NB_PORT] = {
3333
(GPIO_TypeDef *)GPIOA_BASE,
3434
(GPIO_TypeDef *)GPIOB_BASE
3535
#if defined GPIOC_BASE

0 commit comments

Comments
 (0)