This is a feature request to change setSerialMessageCallback
from:
void playdate->system->setSerialMessageCallback(void (*callback)(const char* data));
to:
void playdate->system->setSerialMessageCallback(void (*callback)(const char* data, void* userdata), void* userdata);
My specific motivation for this is that it would allow writing a more idiomatic Rust binding, like this one for playdate->file->listfiles
: playdate/api/fs/src/lib.rs at de8d14cf9b1e689bfed610d9dff60cf0bc452e74 · boozook/playdate · GitHub
As for general motivation, all of the other callbacks have a userdata
argument (as far as I know) which effectively allows us to access state from within the callback.
@fzzr does this make sense to you?
@dave, tagging you since I think you mentioned that you implemented this.
Thanks!