Move Generated Edge AI Lab model define macros from source to header files.

Hi DevZone support team,

We have been using the Nordic Edge AI Lab to create tiny ML models. These models auto-generate the model's C code across three files: 

  • nrf_edgeai_user_model.c‎
  • nrf_edgeai_user_model.h
  • nrf_edgeai_user_types.h

The model exposes multiple useful model `#define` macros. Many of which are necessary when interfacing with the model such as the input type, number of input features/dimensionality, window size, output type and more.

One issue I've run into (from models that I've generated as recently as last month (ID 96375)), is that most of these useful macros are only defined in the model.c source file, meaning that they cannot be easily accessed from other parts of the code (at least not without external scripting).

As a result a lot of these macros end up duplicated in the interfacing code that is used to feed/run the model, and each time the model is swapped out, each of the duplicated macros need to be manually updated too.

Can the generated model code move where these useful macros are defined from the `nrf_edgeai_user_model.c` source file into the `nrf_edgeai_user_model.h` header file?

The C file already imports the header and doing so would then allow other code to access the macro values. This would drastically reduce macro duplication and simplify the process of adding and swapping out models.

Thanks.

Related