cancel
Showing results for 
Search instead for 
Did you mean: 

How to index different GPIO ports in one array

Ahmed Allam
Associate

hi everyone.

I'm trying to index different GPIO ports and pins. 

 

#define STEP1_HALF1_PORT GPIOA

#define STEP2_HALF1_PORT GPIOB

#define STEP3_HALF1_PORT GPIOA

#define STEP4_HALF1_PORT GPIOC

#define STEP5_HALF1_PORT GPIOB

GPIO_TypeDef *Half1StepPortNum[5] = {

STEP1_HALF1_PORT,

STEP2_HALF1_PORT,

STEP3_HALF1_PORT,

STEP4_HALF1_PORT,

STEP5_HALF1_PORT };

 

BUT the code does not work. and stuck 

1 REPLY 1
TDK
Guru

The code you presented is fine. The issue is somewhere else.

 

If you feel a post has answered your question, please click "Accept as Solution".