How to compile and link two programs with a make BOARD=... command

I usually compile my Riot Os application with a single make BOARD=nucleo-f401re command in the application folder. But in this case I need to use the code of I2C.c driver which should be compiled and linked togheter to the main.c. How to do that ? THank you

To use the i2c driver, add

FEATURES_REQUIRED += periph_i2c

to your Makefile and

#include "periph/i2c.h"

to the source file in which you want to call the i2c functions.

1 Like