使用 platformio cli 安装 mjs 库(嵌入式 javascript)时出现问题
Problem installing mjs library (embedded javascript) using platformio cli
将 mjs 中的函数导入 platformio 后尝试使用该函数时出现构建错误:
platformio lib --storage-dir lib install https://github.com/cesanta/mjs.git
我可以尝试 #include <../lib/mjs/mjs.h>
,但它只会包含头文件而不包含 .c 文件。没有链接。
如何将 mjs(或任何带有 .c 的外部库)设置为 platformio 库?
详情:
- 我可以在 main.c 中尝试
#include <mjs.h>
或 #include <mjs/mjs.h>
,但都不起作用。
- 我希望库在编译时被复制到 .pioenvs。
但事实并非如此。
- 我已经从我最喜欢的搜索引擎中尝试了一些东西。但没有运气。 Platformio 文档似乎也没有太大帮助。如果您认为这需要提交 github 问题,请在评论中告诉我。
ESP32 espressif DFU库版本1.5
目前在 Windows 10(将来还将使用 WSL Debian、Gentoo Linux 和 Mac)
platformio.ini
[env:esp32dev]
platform = espressif32
framework = espidf
board = esp32dev
build_flags = -DCONFIG_WIFI_SSID=\"ESP_AP\" -DCONFIG_WIFI_PASSWORD=\"MYPASS\"
monitor_speed = 115200
p.s. I understand there is a gpl restriction after I finish the
prototyping phase (while prototyping, there is no restrictions). So I
do plan on buying a commercial license. I don't think this library
would be a good fit in the platformio store. I want a local-only library.
But many libraries out there could follow the found steps, expanding
platformio usability...
mjs 之前有个项目叫v7。我仍然对导入外部库感兴趣。但这暂时满足了我的需求。
platform.ini
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
build_flags = -I lib/mjs
-L lib/mjs
-I lib/TFT_eSPI-master
-L lib/TFT_eSPI-master
-Os
-DPIO_FRAMEWORK_ESP_IDF_ENABLE_EXCEPTIONS
-DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG
-DUSER_SETUP_LOADED=1
-DILI9163_DRIVER=1
-DTFT_WIDTH=128
-DTFT_HEIGHT=160
-DTFT_MISO=19
-DTFT_MOSI=23
-DTFT_SCLK=18
-DTFT_CS=5
-DTFT_DC=19
-DTFT_RST=-1
-DLOAD_GLCD=1
-DSPI_FREQUENCY=27000000
让 mjs 开始工作。 https://github.com/tamusjroyce/platformio-esp32-mjs
Note: MJS is GPL V2 or commercial. License is reasonable. I am in no
way affiliated with Ciesta, MongooseOS, or mjs. Hence, v7 (which I believe is licensed differently?).
将 mjs 中的函数导入 platformio 后尝试使用该函数时出现构建错误:
platformio lib --storage-dir lib install https://github.com/cesanta/mjs.git
我可以尝试 #include <../lib/mjs/mjs.h>
,但它只会包含头文件而不包含 .c 文件。没有链接。
如何将 mjs(或任何带有 .c 的外部库)设置为 platformio 库?
详情:
- 我可以在 main.c 中尝试
#include <mjs.h>
或#include <mjs/mjs.h>
,但都不起作用。 - 我希望库在编译时被复制到 .pioenvs。
但事实并非如此。 - 我已经从我最喜欢的搜索引擎中尝试了一些东西。但没有运气。 Platformio 文档似乎也没有太大帮助。如果您认为这需要提交 github 问题,请在评论中告诉我。
ESP32 espressif DFU库版本1.5 目前在 Windows 10(将来还将使用 WSL Debian、Gentoo Linux 和 Mac)
platformio.ini
[env:esp32dev]
platform = espressif32
framework = espidf
board = esp32dev
build_flags = -DCONFIG_WIFI_SSID=\"ESP_AP\" -DCONFIG_WIFI_PASSWORD=\"MYPASS\"
monitor_speed = 115200
p.s. I understand there is a gpl restriction after I finish the prototyping phase (while prototyping, there is no restrictions). So I do plan on buying a commercial license. I don't think this library would be a good fit in the platformio store. I want a local-only library.
But many libraries out there could follow the found steps, expanding platformio usability...
mjs 之前有个项目叫v7。我仍然对导入外部库感兴趣。但这暂时满足了我的需求。
platform.ini
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
build_flags = -I lib/mjs
-L lib/mjs
-I lib/TFT_eSPI-master
-L lib/TFT_eSPI-master
-Os
-DPIO_FRAMEWORK_ESP_IDF_ENABLE_EXCEPTIONS
-DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG
-DUSER_SETUP_LOADED=1
-DILI9163_DRIVER=1
-DTFT_WIDTH=128
-DTFT_HEIGHT=160
-DTFT_MISO=19
-DTFT_MOSI=23
-DTFT_SCLK=18
-DTFT_CS=5
-DTFT_DC=19
-DTFT_RST=-1
-DLOAD_GLCD=1
-DSPI_FREQUENCY=27000000
让 mjs 开始工作。 https://github.com/tamusjroyce/platformio-esp32-mjs
Note: MJS is GPL V2 or commercial. License is reasonable. I am in no way affiliated with Ciesta, MongooseOS, or mjs. Hence, v7 (which I believe is licensed differently?).