cancel
Showing results for 
Search instead for 
Did you mean: 

use a hal function outside main

rsharifi9
Associate III
Posted on October 28, 2017 at 12:55

dear Community,

i should to use some HAL functions outside the main.c

i add &sharpinclude ''stm32f4xx_hal.h'' to another c file but error appears for example for SPI:

0690X00000608d2QAA.png0690X00000608jsQAA.png

regards, Ras

#hal #outside-main.c
1 REPLY 1
Posted on October 28, 2017 at 13:26

Hello !

use  ater include :

#include 'stm32f4xx_hal.h'

extern SPI_HandleTypeDef hspi5;

or

extern 'C' {SPI_HandleTypeDef hspi5;}// in case your module is a c++ module.

regards

vf