diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 1c5e20f..6386497 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -28,8 +28,7 @@ "env": { "PATH": "C:\\msys64\\usr\\bin;c:\\msys64\\mingw64\\bin", "MSYSTEM": "MINGW64", - "CC": "gcc", - "RACK_USER_DIR": "${OneDrive}\\Documents\\Rack2" + "CC": "gcc" }, "shell": { "executable": "C:\\msys64\\usr\\bin\\bash.exe", diff --git a/firmware/mock_hardware/common/ftdi.c b/firmware/mock_hardware/common/ftdi.c index 06fb30b..2b97385 100644 --- a/firmware/mock_hardware/common/ftdi.c +++ b/firmware/mock_hardware/common/ftdi.c @@ -17,13 +17,13 @@ u8* ftdi_rx_buf(void) return 0; } -u8 ftdi_rx_bytes(void) +volatile u8 ftdi_rx_bytes(void) { return 0; } -u8 ftdi_rx_busy(void) { return 0; } -u8 ftdi_tx_busy(void) { return 0; } +volatile u8 ftdi_rx_busy(void) { return 0; } +volatile u8 ftdi_tx_busy(void) { return 0; } u8 ftdi_connected(void) { diff --git a/firmware/mock_hardware/include/ftdi.h b/firmware/mock_hardware/include/ftdi.h index 5b5e793..0363dec 100644 --- a/firmware/mock_hardware/include/ftdi.h +++ b/firmware/mock_hardware/include/ftdi.h @@ -13,7 +13,7 @@ void ftdi_change(uhc_device_t* dev, u8 plug); void ftdi_setup(void); u8* ftdi_rx_buf(void); -u8 ftdi_rx_bytes(void); -u8 ftdi_rx_busy(void); -u8 ftdi_tx_busy(void); +volatile u8 ftdi_rx_bytes(void); +volatile u8 ftdi_rx_busy(void); +volatile u8 ftdi_tx_busy(void); u8 ftdi_connected(void); diff --git a/firmware/mock_hardware/mock_serial.c b/firmware/mock_hardware/mock_serial.c index 86e64f0..63d2e3e 100644 --- a/firmware/mock_hardware/mock_serial.c +++ b/firmware/mock_hardware/mock_serial.c @@ -72,7 +72,7 @@ u8* mock_serial_rx_buf(void) return mock_serial_current_message_buffer; } -u8 mock_serial_rx_bytes(void) +volatile u8 mock_serial_rx_bytes(void) { return mock_serial_current_message_length; } diff --git a/firmware/whitewhale-kria b/firmware/whitewhale-kria index 1e0e2fb..35e01bd 160000 --- a/firmware/whitewhale-kria +++ b/firmware/whitewhale-kria @@ -1 +1 @@ -Subproject commit 1e0e2fbb2a81a31ad14ad996c393ed5f6b2c4fbe +Subproject commit 35e01bd5b0627ae63ff3f2611c688435ce9c09e3 diff --git a/lib/serialosc/SerialOsc.cpp b/lib/serialosc/SerialOsc.cpp index 492e7fa..843106b 100644 --- a/lib/serialosc/SerialOsc.cpp +++ b/lib/serialosc/SerialOsc.cpp @@ -413,9 +413,6 @@ void SerialOsc::ProcessMessage(const osc::ReceivedMessage& m, const IpEndpointNa // wait until after size message recieved -MD // listener->deviceFound(device); sendDeviceInfoMessage(device->port); - - sendDevicePrefixMessage(port); - sendDevicePortMessage(port); } else if (address == "/serialosc/remove") { diff --git a/src/common/core/GridConnection/GridConnection.cpp b/src/common/core/GridConnection/GridConnection.cpp index 7de5d67..fcd5404 100644 --- a/src/common/core/GridConnection/GridConnection.cpp +++ b/src/common/core/GridConnection/GridConnection.cpp @@ -1,4 +1,5 @@ #include "GridConnection.hpp" +#include "SerialOscInterface.hpp" void GridConnectionManager::registerGrid(Grid* grid) { @@ -76,6 +77,15 @@ void GridConnectionManager::connect(Grid* grid, IGridConsumer* consumer) consumerToGridMap[consumer] = grid; idToConsumerMap[grid->getDevice().id] = consumer; consumer->gridConnected(grid); + + // If serialosc is managing the grid (e.g. it's a hardware grid), inform serialosc about new grid owner + auto port = grid->getDevice().port; + auto so = SerialOscInterface::get(); + if (port > 0 && so != nullptr && so->driver != nullptr) + { + so->driver->sendDevicePrefixMessage(port); + so->driver->sendDevicePortMessage(port); + } } bool GridConnectionManager::isConnected(IGridConsumer* consumer)