right, that's the fault of a lazy programmer who thought that exposing an integer instead of a constant of the type B115200
was a good idea (me).
Here's the code at fault: https://github.com/BelaPlatform/Bela/blob/e43b8abe25758ae2b12deb3401e4b3d1af289a8d/libraries/Serial/Serial.cpp#L37-L78
the quick solution is as trivial as adding
case 460800: speed = B460800;
break;
to the switch
statement. I think the reason I didn't directly expose #include <termios.h>
so that one could pass e.g.: B460800
is that we wouldn't be able to easily determine whether a user passed a valid B...
symbol (e.g.: B460800
) or an unsigned int
representing the speed (e.g.: 460800
). Not sure what a nicer solution would be if not filling in the switch()
statement in there with any missing cases.