This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430FR4133: Pass an Fast Unsigned 16-bit int array in a Function

Part Number: MSP430FR4133

Hi there,

I am having problems with compiling my code that checks ICs. I have a function that performs the tests on a basic AND gate and outputs a 1 or a 0 depending on whether it works or not. To keep my code as modular an clear as possible I want to pass an array with the pins and ports that will be used. The arrays are defined as follows:

  //Create GPIO port arrays to pass into the tester functions
  uint_fast8_t 14_Pin_IC_Pos_0_LHS_Ports[7] = {GPIO_PORT_P8, GPIO_PORT_P1, GPIO_PORT_P1, GPIO_PORT_P2, GPIO_PORT_P8, GPIO_PORT_P5, GPIO_PORT_P2};
  uint_fast8_t 14_Pin_IC_Pos_0_RHS_Ports[7] = {GPIO_PORT_P1, GPIO_PORT_P1, GPIO_PORT_P5, GPIO_PORT_P5, GPIO_PORT_P5, GPIO_PORT_P1, GPIO_PORT_P1};
  uint_fast16_t 14_Pin_IC_Pos_0_LHS_Pins[] = {GPIO_PIN1, GPIO_PIN1, GPIO_PIN0, GPIO_PIN7, GPIO_PIN0, GPIO_PIN1, GPIO_PIN5};
  uint_fast16_t 14_Pin_IC_Pos_0_RHS_Pins[] = {GPIO_PIN7, GPIO_PIN6, GPIO_PIN0, GPIO_PIN2, GPIO_PIN3, GPIO_PIN3, GPIO_PIN4};

For which I am getting the error on each line: Error[Pe040]: expected an identifier. (I am also getting the same error on the function declaration in my .h files and in the definition in my .c files)

And this function passes the arrays as arguments and it's output value is assigned to an integer "IC_Working".

IC_Working = Quad_2_AND_Tester(14_Pin_IC_Pos_0_LHS_Ports[], 14_Pin_IC_Pos_0_RHS_Ports[], 14_Pin_IC_Pos_0_LHS_Pins[], 14_Pin_IC_Pos_0_RHS_Pins[]);

For which I am getting the error: Error[Pe018]: expected a ")"

The function declaration can be seen bellow:

extern int Quad_2_AND_Tester(uint_fast8_t 14_Pin_IC_LHS_Ports[],
                             uint_fast8_t 14_Pin_IC_RHS_Ports[],
                             uint_fast16_t 14_Pin_IC_LHS_Pins[],
                             uint_fast16_t 14_Pin_IC_RHS_Pins[]);

The weird thing is I have a function that lights up an external LED with different patterns based on the "IC_Working" argument and I am also passing my pins and ports and it works (tested separately). These are the variables passed into the function:

  //Set low and high ports and pins for the LED
  uint_fast8_t selectedHighPort = GPIO_PORT_P8;
  uint_fast8_t selectedLowPort = GPIO_PORT_P8;
  uint_fast16_t selectedHighPin = GPIO_PIN2;
  uint_fast16_t selectedLowPin = GPIO_PIN3;

And this is the function:

  External_LED_Blink(selectedHighPort, selectedHighPin, selectedLowPort, selectedLowPin, IC_Working);

I can't seem to figure out the problem so any help would be very appreciated.

Thank you.

**Attention** This is a public forum