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

BUTTON_PULL in app_uart.c

Since I'm writing code for my own board, I decided to create my own board.h file to hold the board-specific definitions.

However, I can't do this without hacking the SDK, as app_uart.c includes boards.h, which is part of the sdk, and it won't pickup my board.h without hackery.

Call me a purist, but the SDK shouldn't depend on files that change with board-level configuration. I assume this is a bug, but please correct me if there's another appropriate way to have my own board.h file without modifying the SDK or masquerading as a PCA10001.

-Jim

Parents
  • To add your own board, the best way is to add an extra clause to the default boards.h and set the compile-time define you configure. This would limit your change to the SDK files to just boards.h, and I can't see any way to avoid the need for this.

    However, I do agree that this particular use of the define seems unnecessary, so I've reported it internally to change it to NRF_GPIO_PIN_PULLUP. Thanks for letting us know!

  • So the examples should have a boards.h file like this, but I don't think that should be in the SDK; it should be part of the examples package.

    The other reason why the boards.h file is a pain has to do with Eclipse. Hard as I tried, I couldn't get the code analyzer to look at those board files. It has something to do with the way boards.h includes files with a path, but I'm not willing to debug the CDT plugin to figure it out. Eliminating this dependency makes code analysis work in Eclipse.

Reply
  • So the examples should have a boards.h file like this, but I don't think that should be in the SDK; it should be part of the examples package.

    The other reason why the boards.h file is a pain has to do with Eclipse. Hard as I tried, I couldn't get the code analyzer to look at those board files. It has something to do with the way boards.h includes files with a path, but I'm not willing to debug the CDT plugin to figure it out. Eliminating this dependency makes code analysis work in Eclipse.

Children
No Data
Related