From cf5fcf7432d0bf8a3742ab035c4874a1feef2db9 Mon Sep 17 00:00:00 2001 From: Joel Wetzell Date: Mon, 27 Apr 2026 19:05:40 -0500 Subject: [PATCH] update for latest sx128x driver changes --- lilygo-t3s3-sx128x/main.go | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/lilygo-t3s3-sx128x/main.go b/lilygo-t3s3-sx128x/main.go index 143ebf2..87544ec 100644 --- a/lilygo-t3s3-sx128x/main.go +++ b/lilygo-t3s3-sx128x/main.go @@ -66,12 +66,13 @@ func main() { timeout.Store(true) dio1Pin.SetInterrupt(machine.PinRising, func(machine.Pin) { - irqStatus := radio.GetIrqStatus() + irqStatus, _ := radio.GetIrqStatus() if irqStatus&sx128x.IRQ_TX_DONE_MASK != 0 { txDone.Store(true) timeout.Store(false) led.Set(false) + println("tx done") } if irqStatus&sx128x.IRQ_RX_DONE_MASK != 0 { rxDone.Store(true) @@ -103,13 +104,8 @@ func main() { SetupLora(radio, loraConfig) oscMessage := osc.OSCMessage{ - Address: "/lora/button", - Args: []osc.OSCArg{ - { - Type: "i", - Value: 0, - }, - }, + Address: "/cue/1/go", + Args: []osc.OSCArg{}, } for { @@ -120,7 +116,6 @@ func main() { radio.SetStandby(sx128x.STANDBY_RC) led.Set(true) - oscMessage.Args[0].Value = int32(time.Now().UnixMilli() / 1000) bytes, err := oscMessage.ToBytes() if err != nil { println("failed to serialize OSC message:", err) @@ -163,7 +158,7 @@ func main() { func SetupLora(radio *sx128x.Device, config lora.Config) { // Switch to standby prior to configuration changes - circuitMode, _ := radio.GetStatus() + circuitMode, _, _ := radio.GetStatus() if circuitMode != sx128x.CIRCUIT_MODE_STDBY_RC { radio.SetStandby(sx128x.STANDBY_RC) } @@ -184,7 +179,7 @@ func SetupLora(radio *sx128x.Device, config lora.Config) { data[0] = 0x32 } radio.WriteRegister(0x925, data[:]) - existing := radio.ReadRegister(0x93C) + existing, _ := radio.ReadRegister(0x93C) data[0] = existing | 0x01 radio.WriteRegister(0x93C, data[:]) @@ -199,7 +194,7 @@ func SetupLora(radio *sx128x.Device, config lora.Config) { } func checkStatus(radio *sx128x.Device, operation string) { - circuitMode, commandStatus := radio.GetStatus() + circuitMode, commandStatus, _ := radio.GetStatus() if commandStatus != sx128x.COMMAND_STATUS_SUCCESS { println(operation, "-> failed with status:", commandStatus) }