-
Notifications
You must be signed in to change notification settings - Fork 12
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
Roadmap and FAQs #1
Comments
Although the readme claims to support v4.4 to 5.x, it is actually being tested on 5.3-dev. The last commit added a wrapper to handle the IDF version. The main idea was to read the esp_idf_version.h header, but zig couldn't find it even though it had access to the include path. zig-esp-idf-sample/imports/idf-sys.zig Lines 6 to 48 in 414daba
The idea of managing multiple versions of functions could be done in a similar way to crc_xx, depending on the version of the IDF. zig-esp-idf-sample/imports/idf-sys.zig Lines 335 to 342 in 414daba
Reference |
TODO
mini-FAQ
So Zig can read C headers. Why manual wrappers?
Indeed
@cImport
/@cInclude
doesn't access C types directly, but it converts to zig binding automatically (like binding-rs).However, there have been some limits to support at the moment, in particular when converting macros (difficult to parse).
One example is
ESP_LOG
x, which has been done manually, since the original version provided inesp_log.h
has become untranslatable.see: zig doc -
@cImport
vstranslate-c
So why not use microzig to make the project fully zig-written?
I am currently using zig v0.12.0-dev (nightly/master) and the microzig project does not support this version yet.
see: ZigEmbeddedGroup/microzig#178
The use of regz (svd converter) will also need to be evaluated, since it is under development and not all peripherals are guaranteed during translation.
see: ZigEmbeddedGroup/microzig#180
Why did you add C++ example using Zig?
Isn't it clear?
Okay, so instead of using crosstool-NG you switch to
zig c++
/clang++
, but only withlibc++
(LLVM C++ ABI) and notlibstdc++
(GNU C++ ABI).However, the final binary will still be compiled via cmake with crosstool-NG and
libgcc
(compiler ABI), notcompiler-rt
(compiler ABI).see: kubo39/esp32-resource#1
Note: Zig (the toolchain) doesn't just prefer its own language!
The text was updated successfully, but these errors were encountered: