Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jerryx_arg_ignore fail #5137

Open
spuggy0919 opened this issue Apr 14, 2024 · 0 comments
Open

jerryx_arg_ignore fail #5137

spuggy0919 opened this issue Apr 14, 2024 · 0 comments

Comments

@spuggy0919
Copy link

spuggy0919 commented Apr 14, 2024

JERRYX_UNUSED(call_info_p);
int16_t x=1;
int16_t y=2;
uint8_t bitmap;// WARNNING* need to check BUFFERSIZE
char buf[32];// WARNNING need to check BUFFERSIZE
int16_t w=3;
int16_t h=4;
uint16_t color=1;
uint16_t bg=0;

const jerryx_arg_t mapping[] ={
    jerryx_arg_int16(&x, JERRYX_ARG_CEIL, JERRYX_ARG_NO_CLAMP, JERRYX_ARG_NO_COERCE, JERRYX_ARG_REQUIRED),
    jerryx_arg_int16(&y, JERRYX_ARG_CEIL, JERRYX_ARG_NO_CLAMP, JERRYX_ARG_NO_COERCE, JERRYX_ARG_REQUIRED),
    jerryx_arg_ignore(), // TODO process bitmap pointer later
    jerryx_arg_int16(&w, JERRYX_ARG_CEIL, JERRYX_ARG_NO_CLAMP, JERRYX_ARG_NO_COERCE, JERRYX_ARG_REQUIRED),
    jerryx_arg_int16(&h, JERRYX_ARG_CEIL, JERRYX_ARG_NO_CLAMP, JERRYX_ARG_NO_COERCE, JERRYX_ARG_REQUIRED),
    jerryx_arg_uint16(&color, JERRYX_ARG_CEIL, JERRYX_ARG_NO_CLAMP, JERRYX_ARG_NO_COERCE, JERRYX_ARG_REQUIRED),
    jerryx_arg_uint16(&bg, JERRYX_ARG_CEIL, JERRYX_ARG_NO_CLAMP, JERRYX_ARG_NO_COERCE, JERRYX_ARG_OPTIONAL),
};
jerry_value_t rv = jerryx_arg_transform_args(args_p, 7, mapping, 2);
if (jerry_value_is_exception(rv)){
    WSDEBUG_TPRINTF("[sd1306] drawBitmap mapping Error argc(%d) %x\n",args_cnt,rv);
    WSDEBUG_TPRINTF("[sd1306] x%d y%d w%d h%d color%d bg%d \n",x,y,w,h,color,bg);

    return rv;
}

Temporary solution to mapping 2items then mapping last 4 items separately.

root cause the jerryx_arg_transform_ignore did not use (void) js_arg_iter_p; / unused /
to skip one args_p item.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant