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

FreeRTOS pdPASS constant not available #130

Closed
Tuupertunut opened this issue Sep 5, 2022 · 2 comments
Closed

FreeRTOS pdPASS constant not available #130

Tuupertunut opened this issue Sep 5, 2022 · 2 comments

Comments

@Tuupertunut
Copy link

ESP-IDF documentation tells that the FreeRTOS function xTaskCreatePinnedToCore returns pdPASS if it succeeds.

The pdPASS constant is defined here in ESP-IDF headers.

However I can't access this constant from Rust through esp-idf-sys. It is not listed in the docs. Some other constants from the same header file can be found in esp-idf-sys, such as pdFREERTOS_ERRNO_ENOENT.

This is especially important because the value of pdPASS seems to be 1. The C wisdom of "0 means success" doesn't hold here.

@N3xed
Copy link
Collaborator

N3xed commented Sep 7, 2022

This is because of the way those macros are defined. We're using bindgen to generate the esp-idf bindings and it doesn't support generating constants for macros with casts and generally for function-like macros (see rust-lang/rust-bindgen#316).

We need to either define them ourselves or add special logic using bindgen::callbacks::ParseCallbacks::func_macro to generate them ourselves.

@ivmarkov
Copy link
Collaborator

Closing, because for now the philosophy if the project is to just generate raw bindings to whatever is available in the ESP IDF C headers, with very few - if any - customizations. In fact, the one and only exception is the EspError struct and its macros.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

3 participants