Ensure that the function name you use in “coder.ceval” matches the actual function name. In the code you provided, the C function is named “checkcurrentk” and the function call in the “coder.ceval” is “checkcurrent”. This should match unless you have a specific reason for the discrepancy.
Additionally, the error message indicates that you might be passing a “double” to a function that expects a “uint8”. You should check all instances of calling “coder.ceval” and ensure that the types of all arguments match the expected types in the C function declarations.
Addressing these points should resolve the issue. If the issue persists, please provide the complete code to help diagnose the issue further.