cancel
Showing results for 
Search instead for 
Did you mean: 

I have configured 2 SPIs in DMA and I need to get callback for both SPIs (HAL_SPI_TxCpltCallback). I am able to get callback when tried individually, but simultaneously used its causes build error. Error[Li006]: duplicate definitions .

JohnsAby
Associate II

Build Error

Error[Li006]: duplicate definitions for "HAL_SPI_TxCpltCallback";

void HAL_SPI_TxCpltCallback(SPI_HandleTypeDef *hspi)
{
 HAL_GPIO_WritePin(SPIx_NSS_Port, SPIx_NSS_Pin, GPIO_PIN_SET);
}

I use the same in both files ?

any way ? please help

1 ACCEPTED SOLUTION

Accepted Solutions
KnarfB
Principal III

Use one callback only and an if statement in the beginning to find out which hspi is calling.

hth

KnarfB

View solution in original post

2 REPLIES 2
KnarfB
Principal III

Use one callback only and an if statement in the beginning to find out which hspi is calling.

hth

KnarfB

Thanks KnarfB for the fast response. It worked.