comment out gpio stuff

This commit is contained in:
dylan
2024-04-04 08:58:39 -07:00
parent 85cbf665f0
commit 903c66b1d9
3 changed files with 76 additions and 48 deletions
+24 -20
View File
@@ -19,19 +19,19 @@ export const GamePage = () => {
url: `/api/ws/room?room=${room}`,
// url: "wss://echo.websocket.org",
onMessage({message}) {
const msg = message as any;
if (msg.type === "gpio") {
if (picoRef.current) {
const handle = picoRef.current.getPicoConsoleHandle();
if (handle) {
console.log("updating pico gpio");
(handle.gpio as any).dontSend = true;
handle.gpio.length = 0;
handle.gpio.push(...msg.gpio);
(handle.gpio as any).dontSend = false;
}
}
}
// const msg = message as any;
// if (msg.type === "gpio") {
// if (picoRef.current) {
// const handle = picoRef.current.getPicoConsoleHandle();
// if (handle) {
// console.log("updating pico gpio");
// (handle.gpio as any).dontSend = true;
// handle.gpio.length = 0;
// handle.gpio.push(...msg.gpio);
// (handle.gpio as any).dontSend = false;
// }
// }
// }
console.log('message', message);
}
})
@@ -95,13 +95,17 @@ export const GamePage = () => {
border: 2px solid limegreen;
}
`}>
<Pico8Console ref={picoRef} carts={info.release.carts} onGpioChange={(gpio: number[]) => {
console.log("sending gpio");
socket.sendMessage({
type: "gpio",
gpio,
});
}} />
<Pico8Console
ref={picoRef}
carts={info.release.carts}
// onGpioChange={(gpio: number[]) => {
// console.log("sending gpio");
// socket.sendMessage({
// type: "gpio",
// gpio,
// });
// }}
/>
</div>
<div className={css`
display: flex;