Skip to content

Commit b6054c0

Browse files
committed
Forward port changes from v0.6 release branch
Merge #1643 (Force git clone of Pico-SDK) and #1644 (Fix error result in esp32 spi_driver) from release-0.6 branch.
2 parents 0578eb4 + 4a6e5a9 commit b6054c0

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

src/platforms/esp32/components/avm_builtins/gpio_driver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ static NativeHandlerResult consume_gpio_mailbox(Context *ctx)
630630
}
631631

632632
term ret_msg;
633-
if (UNLIKELY(memory_ensure_free_with_roots(ctx, 3, 1, &ret, MEMORY_CAN_SHRINK) != MEMORY_GC_OK)) {
633+
if (UNLIKELY(memory_ensure_free_with_roots(ctx, TUPLE_SIZE(2), 1, &ret, MEMORY_CAN_SHRINK) != MEMORY_GC_OK)) {
634634
ret_msg = OUT_OF_MEMORY_ATOM;
635635
} else {
636636
ret_msg = create_pair(ctx, gen_message.ref, ret);

src/platforms/esp32/components/avm_builtins/spi_driver.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -655,14 +655,14 @@ static NativeHandlerResult spidriver_consume_mailbox(Context *ctx)
655655
default:
656656
TRACE("spi: error: unrecognized command.\n");
657657
if (UNLIKELY(memory_ensure_free(ctx, TUPLE_SIZE(2)) != MEMORY_GC_OK)) {
658-
return OUT_OF_MEMORY_ATOM;
658+
ret = OUT_OF_MEMORY_ATOM;
659659
}
660660
term unkn_a = globalcontext_make_atom(ctx->global, ATOM_STR("\xF", "unknown_command"));
661-
return create_pair(ctx, ERROR_ATOM, esp_err_to_term(ctx->global, unkn_a));
661+
ret = create_pair(ctx, ERROR_ATOM, esp_err_to_term(ctx->global, unkn_a));
662662
}
663663

664664
term ret_msg;
665-
if (UNLIKELY(memory_ensure_free_with_roots(ctx, 3, 1, &ret, MEMORY_CAN_SHRINK) != MEMORY_GC_OK)) {
665+
if (UNLIKELY(memory_ensure_free_with_roots(ctx, TUPLE_SIZE(2), 1, &ret, MEMORY_CAN_SHRINK) != MEMORY_GC_OK)) {
666666
ret_msg = OUT_OF_MEMORY_ATOM;
667667
} else {
668668
ret_msg = create_pair(ctx, gen_message.ref, ret);

src/platforms/rp2/pico_sdk_import.cmake

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@
2727
# This can be dropped into an external project to help locate this SDK
2828
# It should be include()ed prior to project()
2929

30-
if (DEFINED ENV{PICO_SDK_PATH} AND (NOT PICO_SDK_PATH))
31-
set(PICO_SDK_PATH $ENV{PICO_SDK_PATH})
32-
message("Using PICO_SDK_PATH from environment ('${PICO_SDK_PATH}')")
33-
endif ()
30+
# Commented to ensure fork is picked up as we need some changes that are not available upstream yet
31+
# if (DEFINED ENV{PICO_SDK_PATH} AND (NOT PICO_SDK_PATH))
32+
# set(PICO_SDK_PATH $ENV{PICO_SDK_PATH})
33+
# message("Using PICO_SDK_PATH from environment ('${PICO_SDK_PATH}')")
34+
# endif ()
3435

3536
if (DEFINED ENV{PICO_SDK_FETCH_FROM_GIT} AND (NOT PICO_SDK_FETCH_FROM_GIT))
3637
set(PICO_SDK_FETCH_FROM_GIT $ENV{PICO_SDK_FETCH_FROM_GIT})

0 commit comments

Comments
 (0)