Added the zig_main project to software for zig based implementation of code for robot

This commit is contained in:
2026-05-05 20:14:04 +12:00
parent 7d752f2534
commit f21f909a71
83 changed files with 13631 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
/* bt_stubs.h — Static inline wrappers for BT macros that zig translate-c
* cannot handle directly.
*
* Included by stubs.h AFTER bindings.h (which pulls in esp_bt.h).
* The translate-c pipeline converts these into callable Zig functions
* inside idf-sys.zig.
*/
#ifndef BT_STUBS_H
#define BT_STUBS_H
#ifndef CONFIG_IDF_TARGET_ESP32S2 /* No BT in ESP32-S2 */
#ifdef CONFIG_BT_ENABLED
/*
* BT_CONTROLLER_INIT_CONFIG_DEFAULT() is a macro that expands to a
* designated-initialiser struct literal — translate-c chokes on it.
* Wrapping it in a static inline function lets the C preprocessor
* expand the macro before translate-c sees the AST.
*/
static inline esp_bt_controller_config_t zig_bt_controller_default_cfg(void)
{
esp_bt_controller_config_t cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT();
return cfg;
}
#endif /* CONFIG_BT_ENABLED */
#endif /* !CONFIG_IDF_TARGET_ESP32S2 */
#endif /* BT_STUBS_H */