This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

The 'HOST' #define in light switch examples

In the examples I see places where there is conditional code based on the #define HOST.

For example in function nrf_mesh_init() i see that the softdevice is only enabled if HOST is undefined.

That seems to suggest that I integrate the mesh code into my firmware where I already call softdevice, then I need to ensure the HOST is defined

I have checked in the segger ide appropriate place for preprocessor defines and I see HOST is not defined there.

I wish Nordic could adopt a convention that for this example in the preprocessor definitions there is an explicit 'notHOST' which conveys to the reader that there is a significance to that hash define

The absence of 'HOST' leads to confusion, the presence of 'notHOST' will give the some relevant information.

I worked for a consultancy 2 decades ago and they drilled that into me :-)

Parents Reply
  • I note that if the HOST is defined the softdevice initialisation code is not called. Given I plan to integrate the mesh code into our standard firmware image where we already enable the softdevice I actually do not want that code to be called in the mesh stack. But now given you mention it is for unit testing I am nervous that I define HOST for my project.

    Can you make any recommendations for my integration use case?

Children
No Data
Related