Skip to content

Conversation

Copy link

Copilot AI commented Nov 27, 2025

microbit_ble_on_error is declared inside namespace codal in the header but defined in global namespace in the .cpp file, causing linker errors when MICROBIT_DMESG_LEVEL_DEBUG and DEVICE_BLE are both enabled.

Fix: Replace using namespace codal; with an explicit namespace block:

namespace codal
{

#if ( MICROBIT_DMESG_LEVEL >= MICROBIT_DMESG_LEVEL_DEBUG)
microbit_ble_ret_code_t microbit_ble_on_error( microbit_ble_ret_code_t err, const char *msg)
{
    // ...
}
#endif

} // namespace codal

using namespace allows access to symbols but doesn't place definitions into that namespace.

Original prompt

This section details on the original issue you should resolve

<issue_title>Specifying MICROBIT_DMESG_LEVEL_DEBUG and DEVICE_BLE causes compilation error</issue_title>
<issue_description>/source/bluetooth/MicroBitBLETypes.cpp does not place microbit_ble_on_error in the codal namespace.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Fix compilation error caused by microbit_ble_on_error placement Fix compilation error: Place microbit_ble_on_error in codal namespace Nov 27, 2025
Copilot AI requested a review from jamesadevine November 27, 2025 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Specifying MICROBIT_DMESG_LEVEL_DEBUG and DEVICE_BLE causes compilation error

2 participants