Skip to content

Commit 38e9442

Browse files
committed
update to atom 0.6 and esp-idf 5+ support
1 parent fcfc7d0 commit 38e9442

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ idf_component_register(
2929
)
3030

3131
idf_build_set_property(
32-
LINK_OPTIONS "-Wl,--whole-archive ${CMAKE_CURRENT_BINARY_DIR}/lib${COMPONENT_NAME}.a -Wl,--no-whole-archive"
32+
LINK_OPTIONS "-Wl,--whole-archive;${CMAKE_CURRENT_BINARY_DIR}/lib${COMPONENT_NAME}.a;-Wl,--no-whole-archive"
3333
APPEND
3434
)

nifs/atomvm_esp32cam.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ static camera_config_t *create_camera_config(framesize_t frame_size, int jpeg_qu
123123
config->pin_pwdn = AI_THINKER_CAM_PIN_PWDN;
124124
config->pin_reset = AI_THINKER_CAM_PIN_RESET;
125125
config->pin_xclk = AI_THINKER_CAM_PIN_XCLK;
126-
config->pin_sscb_sda = AI_THINKER_CAM_PIN_SIOD;
127-
config->pin_sscb_scl = AI_THINKER_CAM_PIN_SIOC;
126+
config->pin_sccb_sda = AI_THINKER_CAM_PIN_SIOD;
127+
config->pin_sccb_scl = AI_THINKER_CAM_PIN_SIOC;
128128
config->pin_d7 = AI_THINKER_CAM_PIN_D7;
129129
config->pin_d6 = AI_THINKER_CAM_PIN_D6;
130130
config->pin_d5 = AI_THINKER_CAM_PIN_D5;
@@ -223,7 +223,7 @@ static term nif_esp32cam_capture(Context *ctx, int argc, term argv[])
223223
ESP_LOGE(TAG, "Image memory allocation (%i) failed", fb->len);
224224
RAISE_ERROR(MEMORY_ATOM);
225225
}
226-
term image = term_from_literal_binary((const char *)fb->buf, fb->len, ctx);
226+
term image = term_from_literal_binary((const char *)fb->buf, fb->len, &ctx->heap, ctx->global);
227227
esp_camera_fb_return(fb);
228228

229229
return port_create_tuple2(ctx, OK_ATOM, image);
@@ -271,5 +271,5 @@ const struct Nif *atomvm_esp32cam_get_nif(const char *nifname)
271271

272272
#include <sdkconfig.h>
273273
#ifdef CONFIG_AVM_ESP32CAM_ENABLE
274-
REGISTER_NIF_COLLECTION(atomvm_esp32cam, atomvm_esp32cam_init, atomvm_esp32cam_get_nif)
274+
REGISTER_NIF_COLLECTION(atomvm_esp32cam, atomvm_esp32cam_init, NULL, atomvm_esp32cam_get_nif)
275275
#endif

nifs/include/atomvm_esp32cam.h

+6
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,10 @@
2424
void atomvm_esp32cam_init(GlobalContext *global);
2525
const struct Nif *atomvm_esp32cam_get_nif(const char *nifname);
2626

27+
// TODO: deprecated helper, remove this
28+
static inline term context_make_atom(Context *ctx, AtomString string)
29+
{
30+
return globalcontext_make_atom(ctx->global, string);
31+
}
32+
2733
#endif

0 commit comments

Comments
 (0)