Update UART settings.
This commit is contained in:
19
user_io.cpp
19
user_io.cpp
@@ -556,6 +556,17 @@ int GetUARTMode()
|
||||
return 0;
|
||||
}
|
||||
|
||||
int SetUARTMode(int mode)
|
||||
{
|
||||
if (is_st()) tos_uart_mode(mode != 3);
|
||||
MakeFile("/tmp/CORENAME", user_io_get_core_name_ex());
|
||||
MakeFile("/tmp/UART_SPEED", is_st() ? "19200" : "115200");
|
||||
|
||||
char cmd[32];
|
||||
sprintf(cmd, "uartmode %d", mode & 0xFF);
|
||||
system(cmd);
|
||||
}
|
||||
|
||||
int GetMidiLinkMode()
|
||||
{
|
||||
struct stat filestat;
|
||||
@@ -568,7 +579,6 @@ int GetMidiLinkMode()
|
||||
|
||||
void SetMidiLinkMode(int mode)
|
||||
{
|
||||
MakeFile("/tmp/CORENAME", user_io_get_core_name_ex());
|
||||
remove("/tmp/ML_FSYNTH");
|
||||
remove("/tmp/ML_MUNT");
|
||||
remove("/tmp/ML_UDP");
|
||||
@@ -932,12 +942,9 @@ void user_io_init(const char *path, const char *xml)
|
||||
FileLoadConfig(mainpath, &mode, 4);
|
||||
}
|
||||
|
||||
char cmd[32];
|
||||
system("uartmode 0");
|
||||
|
||||
SetUARTMode(0);
|
||||
SetMidiLinkMode((mode >> 8) & 0xFF);
|
||||
sprintf(cmd, "uartmode %d", mode & 0xFF);
|
||||
system(cmd);
|
||||
SetUARTMode(mode);
|
||||
}
|
||||
|
||||
static int joyswap = 0;
|
||||
|
||||
Reference in New Issue
Block a user