Accept constant lists in extensions

This commit is contained in:
Benjamin Vedder 2023-04-06 17:55:40 +02:00
parent 415c838d81
commit 460f9c6e87
3 changed files with 10 additions and 10 deletions

View File

@ -24,7 +24,7 @@
#define FW_VERSION_MAJOR 6
#define FW_VERSION_MINOR 05
// Set to 0 for building a release and iterate during beta test builds
#define FW_TEST_VERSION_NUMBER 6
#define FW_TEST_VERSION_NUMBER 7
#include "datatypes.h"

View File

@ -634,7 +634,7 @@ lbm_value ext_load_native_lib(lbm_value *args, lbm_uint argn) {
cif.cif.lbm_dec_sym = lbm_dec_sym;
cif.cif.lbm_is_byte_array = lbm_is_array_r;
cif.cif.lbm_is_cons = lbm_is_cons;
cif.cif.lbm_is_cons = lbm_is_cons_general;
cif.cif.lbm_is_number = lbm_is_number;
cif.cif.lbm_is_char = lbm_is_char;
cif.cif.lbm_is_symbol = lbm_is_symbol;

View File

@ -844,7 +844,7 @@ static lbm_value ext_get_imu_gyro_derot(lbm_value *args, lbm_uint argn) {
}
static lbm_value ext_send_data(lbm_value *args, lbm_uint argn) {
if (argn != 1 || (!lbm_is_cons(args[0]) && !lbm_is_array_r(args[0]))) {
if (argn != 1 || (!lbm_is_cons_general(args[0]) && !lbm_is_array_r(args[0]))) {
return ENC_SYM_EERROR;
}
@ -859,7 +859,7 @@ static lbm_value ext_send_data(lbm_value *args, lbm_uint argn) {
to_send_ptr = (uint8_t*)array->data;
ind = array->size;
} else {
while (lbm_is_cons(curr)) {
while (lbm_is_cons_general(curr)) {
lbm_value arg = lbm_car(curr);
if (lbm_is_number(arg)) {
@ -1856,7 +1856,7 @@ static lbm_value ext_can_send(lbm_value *args, lbm_uint argn, bool is_eid) {
memcpy(to_send, array->data, ind);
} else {
while (lbm_is_cons(curr)) {
while (lbm_is_cons_general(curr)) {
lbm_value arg = lbm_car(curr);
if (lbm_is_number(arg)) {
@ -2194,7 +2194,7 @@ static void wait_uart_tx_task(void *arg) {
}
static lbm_value ext_uart_write(lbm_value *args, lbm_uint argn) {
if (argn != 1 || (!lbm_is_cons(args[0]) && !lbm_is_array_r(args[0]))) {
if (argn != 1 || (!lbm_is_cons_general(args[0]) && !lbm_is_array_r(args[0]))) {
return ENC_SYM_EERROR;
}
@ -2213,7 +2213,7 @@ static lbm_value ext_uart_write(lbm_value *args, lbm_uint argn) {
ind = array->size;
} else {
lbm_value curr = args[0];
while (lbm_is_cons(curr)) {
while (lbm_is_cons_general(curr)) {
lbm_value arg = lbm_car(curr);
if (lbm_is_number(arg)) {
@ -2402,7 +2402,7 @@ static lbm_value ext_i2c_tx_rx(lbm_value *args, lbm_uint argn) {
txlen = array->size;
} else {
lbm_value curr = args[1];
while (lbm_is_cons(curr)) {
while (lbm_is_cons_general(curr)) {
lbm_value arg = lbm_car(curr);
if (lbm_is_number(arg)) {
@ -3604,9 +3604,9 @@ static lbm_value log_send_fxx(bool is_64, lbm_value *args, lbm_uint argn) {
mempools_free_packet_buffer(buffer);
return ENC_SYM_EERROR;
}
} else if (lbm_is_cons(args[arg_now])) {
} else if (lbm_is_cons_general(args[arg_now])) {
lbm_value curr = args[arg_now];
while (lbm_is_cons(curr)) {
while (lbm_is_cons_general(curr)) {
lbm_value val = lbm_car(curr);
if (lbm_is_number(val)) {
if (is_64) {