Skip to content

Commit

Permalink
[nrfconnect] Fixed building issues that appeared after last NCS updat…
Browse files Browse the repository at this point in the history
…e. (#3244)

There are few building issues in the nrfconnect samples, which appeared
after last NCS upmerge:
* No such file or directory when including "nrf_cc3xx_platform_mutex.h".
* 'isascii' was not declared in this scope in CHIPArgParses.cpp file.
* 'strcasecmp' was not declared in this scope in CHIPArgeParses.cpp file.
* Invalid conversion from 'const device*' to 'device*' in LightingManagerImpl.cpp file,
when calling device_get_binding() method.

* Temporarly added include path to the missing file in the nrfconnect-app.cmake file,
what will be removed after fixing and merging PR with fix in the nrfxlib.
* Removed deprecated isascii method, as isgraph check is enough for this use case.
* Added -std=gnu++11 option to the compiler flags, as strcasecmp is not present in c++11 sources.
* Performed const_cast to fit into the new device_get_binding() method API.
  • Loading branch information
kkasperczyk-no authored Oct 16, 2020
1 parent 40f26bf commit e31b2c5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion config/nrfconnect/chip-lib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ function(chip_configure TARGET_NAME)
convert_list_of_flags_to_string_of_flags(CHIP_CFLAGS CHIP_CFLAGS)

zephyr_get_compile_flags(CHIP_CXXFLAGS CXX)
list(FILTER CHIP_CXXFLAGS EXCLUDE REGEX -std.*) # CHIP adds gnu++11 anyway...
list(FILTER CHIP_CXXFLAGS EXCLUDE REGEX -std.*)
list(APPEND CHIP_CXXFLAGS "-std=gnu++11")
convert_list_of_flags_to_string_of_flags(CHIP_CXXFLAGS CHIP_CXXFLAGS)

set(GN_ARGS "")
Expand Down
3 changes: 3 additions & 0 deletions config/nrfconnect/nrfconnect-app.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ endif()
# ==================================================
find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})

# This is temporary solution and should be removed after merging including fix in Zephyr
zephyr_include_directories("${ZEPHYR_BASE}/../nrfxlib/crypto/nrf_cc310_platform/include")

# ==================================================
# General settings
# ==================================================
Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/nrfconnect/main/LightingManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ int LightingManager::Init(const char * gpioDeviceName, gpio_pin_t gpioPin)

mState = kState_On;
mGPIOPin = gpioPin;
mGPIODevice = device_get_binding(gpioDeviceName);
mGPIODevice = const_cast<device *>(device_get_binding(gpioDeviceName));

if (!mGPIODevice)
{
Expand Down
2 changes: 1 addition & 1 deletion src/lib/support/CHIPArgParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ static bool HelpTextContainsShortOption(char optChar, const char * helpText);

static inline bool IsShortOptionChar(int ch)
{
return isascii(ch) && isgraph(ch);
return isgraph(ch);
}

/**
Expand Down

0 comments on commit e31b2c5

Please sign in to comment.