Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation errors using Platformio's IDE (Visual Studio Code) #13

Open
afpineda opened this issue Nov 13, 2021 · 1 comment
Open

Compilation errors using Platformio's IDE (Visual Studio Code) #13

afpineda opened this issue Nov 13, 2021 · 1 comment

Comments

@afpineda
Copy link

afpineda commented Nov 13, 2021

Hi. Just to note:
I tried to compile an empty project (just libraries) in VisualStudio Code and PlatformIO's IDE plugin. Previously, I downloaded and installed mbed-ble-hid using the builtin library manager. Then I came into some compilation errors and warnings at Mbed_BLE_HID.cpp.

The issue

PlatformIO's library manager seems to download an outdated version.

The workarround

I downloaded a fresh copy from this repository (master branch) to overwrite PlatformIO's files. Now, there are no compilation errors, but warnings:

[{
	"resource": "/d:/Documentos/dev/PlatformIO/PruebasChungas/Test1/.pio/libdeps/nano33ble/Mbed BLE HID/src/Mbed_BLE_HID.cpp",
	"owner": "cpp",
	"severity": 4,
	"message": "'int mbed::TimerBase::read_ms() const' is deprecated: Use the Chrono-based elapsed_time method.  If integer milliseconds are needed, you can use `duration_cast<milliseconds>(elapsed_time()).count()` [since mbed-os-6.0.0] [-Wdeprecated-declarations]",
	"startLineNumber": 51,
	"startColumn": 47,
	"endLineNumber": 51,
	"endColumn": 47
},{
	"resource": "/d:/Documentos/dev/PlatformIO/PruebasChungas/Test1/.pio/libdeps/nano33ble/Mbed BLE HID/src/Mbed_BLE_HID.cpp",
	"owner": "cpp",
	"severity": 4,
	"message": "'int events::EventQueue::call_every(int, F) [with F = void (*)()]' is deprecated: Pass a chrono duration, not an integer millisecond count. For example use `5s` rather than `5000`. [since mbed-os-6.0.0] [-Wdeprecated-declarations]",
	"startLineNumber": 71,
	"startColumn": 36,
	"endLineNumber": 71,
	"endColumn": 36
},{
	"resource": "/d:/Documentos/dev/PlatformIO/PruebasChungas/Test1/.pio/libdeps/nano33ble/Mbed BLE HID/src/Mbed_BLE_HID.cpp",
	"owner": "cpp",
	"severity": 4,
	"message": "'void rtos::ThisThread::sleep_for(uint32_t)' is deprecated: Pass a chrono duration, not an integer millisecond count. For example use `5s` rather than `5000`. [since mbed-os-6.0.0] [-Wdeprecated-declarations]",
	"startLineNumber": 78,
	"startColumn": 44,
	"endLineNumber": 78,
	"endColumn": 44
},{
	"resource": "/d:/Documentos/dev/PlatformIO/PruebasChungas/Test1/.pio/libdeps/nano33ble/Mbed BLE HID/src/Mbed_BLE_HID.cpp",
	"owner": "cpp",
	"severity": 4,
	"message": "'ble::BLE::InstanceID_t ble::BLE::getInstanceID() const' is deprecated: BLE singleton supports one instance. You may create multipleinstances by using the constructor. [since mbed-os-6.3.0] [-Wdeprecated-declarations]",
	"startLineNumber": 98,
	"startColumn": 25,
	"endLineNumber": 98,
	"endColumn": 25
},{
	"resource": "/d:/Documentos/dev/PlatformIO/PruebasChungas/Test1/.pio/libdeps/nano33ble/Mbed BLE HID/src/Mbed_BLE_HID.cpp",
	"owner": "cpp",
	"severity": 4,
	"message": "unused variable 'sm' [-Wunused-variable]",
	"startLineNumber": 203,
	"startColumn": 9,
	"endLineNumber": 203,
	"endColumn": 9
},{
	"resource": "/d:/Documentos/dev/PlatformIO/PruebasChungas/Test1/.pio/libdeps/nano33ble/Mbed BLE HID/src/Mbed_BLE_HID.cpp",
	"owner": "cpp",
	"severity": 4,
	"message": "unused variable 'handle' [-Wunused-variable]",
	"startLineNumber": 204,
	"startColumn": 8,
	"endLineNumber": 204,
	"endColumn": 8
}]
@tcoppex
Copy link
Owner

tcoppex commented Nov 13, 2021

Hi @afpineda and thanks for your feedback,

Yes this project expects Mbed OS v5.x which I believe is the one used by the current Arduino IDE. While I also prefer PlatformIO I try to keep compatibility with Arduino as a priority.

I did not catch this issue on Sublime-Text and Deviot but your fix can become handy for others, thank you !

Edit : While I think about it I do have updated master a few days ago for an issue I'm working on but this should not have fixed any compilation errors. I certainly should have branch though.

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

No branches or pull requests

2 participants