stm32/kinetis_pins.cpp: remove PORTS array - duplicates ports array (#1527)

This commit is contained in:
dron0gus 2020-06-21 22:59:18 +03:00 committed by GitHub
parent e57fbcb24b
commit 6992a541f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 3 additions and 21 deletions

View File

@ -10,10 +10,6 @@
#include "engine.h"
#include "pin_repository.h"
extern ioportid_t PORTS[];
ioportid_t PORTS[] = { GPIOA, GPIOB, GPIOC, GPIOD, GPIOE};
#if HAL_USE_ADC || defined(__DOXYGEN__)
// ADC_CHANNEL_IN0 // PA2 (def=VIGN)

View File

@ -20,10 +20,7 @@ static ioportid_t ports[] = {GPIOA,
GPIOB,
GPIOC,
GPIOD,
GPIOE,
nullptr,
nullptr,
nullptr,
GPIOE
};
#define PIN_REPO_SIZE (sizeof(ports) / sizeof(ports[0])) * PORT_SIZE
@ -33,8 +30,6 @@ static const char *PIN_USED[PIN_REPO_SIZE + BOARD_EXT_PINREPOPINS];
#include "pin_repository.h"
#include "io_pins.h"
extern ioportid_t PORTS[];
/**
* @deprecated - use hwPortname() instead
*/
@ -88,7 +83,7 @@ ioportid_t getHwPort(const char *msg, brain_pin_e brainPin) {
firmwareError(CUSTOM_ERR_INVALID_PIN, "%s: Invalid brain_pin_e: %d", msg, brainPin);
return GPIO_NULL;
}
return PORTS[(brainPin - GPIOA_0) / PORT_SIZE];
return ports[(brainPin - GPIOA_0) / PORT_SIZE];
}
/**

View File

@ -17,12 +17,6 @@
#if EFI_PROD_CODE
#include "mpu_util.h"
#include "backup_ram.h"
extern ioportid_t PORTS[];
#if defined(STM32F4XX) || defined(STM32F7XX)
ioportid_t PORTS[] = { GPIOA, GPIOB, GPIOC, GPIOD, GPIOE, GPIOF, GPIOG, GPIOH };
#else
ioportid_t PORTS[] = { GPIOA, GPIOB, GPIOC, GPIOD, GPIOF};
#endif /* defined(STM32F4XX) || defined(STM32F7XX) */
#endif /* EFI_PROD_CODE */
#if HAL_USE_ADC

View File

@ -47,9 +47,6 @@ static ioportid_t ports[] = {GPIOA,
// todo: move this into PinRepository class
static const char *PIN_USED[PIN_REPO_SIZE + BOARD_EXT_PINREPOPINS];
extern ioportid_t PORTS[];
/**
* @deprecated - use hwPortname() instead
*/
@ -131,7 +128,7 @@ ioportid_t getHwPort(const char *msg, brain_pin_e brainPin) {
firmwareError(CUSTOM_ERR_INVALID_PIN, "%s: Invalid brain_pin_e: %d", msg, brainPin);
return GPIO_NULL;
}
return PORTS[(brainPin - GPIOA_0) / PORT_SIZE];
return ports[(brainPin - GPIOA_0) / PORT_SIZE];
}
/**