From 47ade4787e4993981f13191d83fe4197dd5547fc Mon Sep 17 00:00:00 2001 From: Michael Dewberry Date: Sat, 28 Sep 2024 16:52:00 -0400 Subject: [PATCH 1/3] Move prefix/port messages from on-detection to on-connection --- lib/serialosc/SerialOsc.cpp | 3 --- src/common/core/GridConnection/GridConnection.cpp | 10 ++++++++++ 2 files changed, 10 insertions(+), 3 deletions(-) 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) From 2821d7516899adf60aff830633c00f5f43e104b5 Mon Sep 17 00:00:00 2001 From: Michael Dewberry Date: Sun, 29 Sep 2024 00:23:28 -0400 Subject: [PATCH 2/3] Fix Windows build plugin output location --- .vscode/tasks.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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", From 2fe101a187d595b75d0dbbad8cfcf64bc0bd9c5e Mon Sep 17 00:00:00 2001 From: Michael Dewberry Date: Mon, 7 Oct 2024 00:43:17 -0400 Subject: [PATCH 3/3] fix compiler complaints about volatile on macos --- firmware/mock_hardware/common/ftdi.c | 6 +++--- firmware/mock_hardware/include/ftdi.h | 6 +++--- firmware/mock_hardware/mock_serial.c | 2 +- firmware/whitewhale-kria | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) 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