Skip to content

Commit 8e70c09

Browse files
committed
Remove mlogv32-utils overrun logic
1 parent 5189a48 commit 8e70c09

File tree

6 files changed

+8
-20
lines changed

6 files changed

+8
-20
lines changed

console.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ fi
3838

3939
if [[ "$sendRequest" == "true" ]]; then
4040
{
41-
echo "{\"type\": \"serial\", \"device\": \"$device\", \"overrun\": false, \"direction\": \"$direction\", \"disconnectOnHalt\": $disconnectOnHalt}"
41+
echo "{\"type\": \"serial\", \"device\": \"$device\", \"direction\": \"$direction\", \"disconnectOnHalt\": $disconnectOnHalt}"
4242
cat
4343
} | netcat -v "$host" "$port"
4444
else

mod/src/main/kotlin/gay/object/mlogv32/ProcessorAccess.kt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,6 @@ enum class UartDirection {
454454
@SerialName("serial")
455455
data class SerialRequest(
456456
val device: UartDevice,
457-
val overrun: Boolean,
458457
val direction: UartDirection = UartDirection.both,
459458
val stopOnHalt: Boolean = false,
460459
val disconnectOnHalt: Boolean = false,
@@ -488,15 +487,11 @@ data class SerialRequest(
488487

489488
if (direction.transmit) {
490489
rx.readAvailable(1) { buffer ->
491-
val bytes = if (overrun) {
492-
buffer.size.toInt()
493-
} else {
494-
min(buffer.size.toInt(), uart.availableForWrite)
495-
}
490+
val bytes = min(buffer.size.toInt(), uart.availableForWrite)
496491

497492
for (i in 0..<bytes) {
498493
val byte = buffer.readUByte()
499-
if (!uart.write(byte, signalOverflow = overrun)) overflowCount++
494+
if (!uart.write(byte)) overflowCount++
500495
}
501496

502497
bytes

mod/src/main/kotlin/gay/object/mlogv32/UartAccess.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,11 @@ class UartAccess(private val build: MemoryBuild, private val capacity: Int) {
3333
return byte
3434
}
3535

36-
fun write(byte: UByte, signalOverflow: Boolean): Boolean {
36+
fun write(byte: UByte): Boolean {
3737
val nextWptr = wrap(txWptr + 1)
3838

39-
// full, maybe signal overflow
39+
// full :(
4040
if (nextWptr == txRptr) {
41-
if (signalOverflow) {
42-
txWptrRaw = txWptr or 0x100
43-
}
4441
return false
4542
}
4643

python/src/mlogv32/processor_access.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,12 @@ def serial(
8484
self,
8585
device: UartDevice,
8686
*,
87-
overrun: bool = False,
8887
stop_on_halt: bool = False,
8988
disconnect_on_halt: bool = False,
9089
):
9190
self._send_request(
9291
SerialRequest(
9392
device=device,
94-
overrun=overrun,
9593
direction="both",
9694
stopOnHalt=stop_on_halt,
9795
disconnectOnHalt=disconnect_on_halt,
@@ -178,7 +176,6 @@ class StatusRequest(BaseModel):
178176
class SerialRequest(BaseModel):
179177
type: Literal["serial"] = "serial"
180178
device: UartDevice
181-
overrun: bool
182179
direction: UartDirection
183180
stopOnHalt: bool
184181
disconnectOnHalt: bool

rust/examples/ppp/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,18 @@ Based on the example in https://github.com/embassy-rs/ppproto/blob/bd16b3093fe2e
44

55
Steps:
66

7-
- Make sure UART_FIFO_CAPACITY in the CONFIG proc is set to 253.
87
- Start the mlogv32-utils socket server.
98
- Run each of the following commands in a separate terminal (replace `127.0.0.1` with your [host ip](https://learn.microsoft.com/en-us/windows/wsl/networking#accessing-windows-networking-apps-from-linux-host-ip) if using WSL):
109

1110
```sh
1211
# show log output from uart0
13-
echo '{"type":"serial","device":"uart0","stopOnHalt":false,"overrun":false}' | netcat -v 127.0.0.1 5000
12+
echo '{"type":"serial","device":"uart0","stopOnHalt":false}' | netcat -v 127.0.0.1 5000
1413

1514
# relay socket server to pty
1615
socat -v -x TCP4:127.0.0.1:5000 PTY,link=pty,rawer
1716

1817
# connect pppd to uart1
19-
sudo pppd $PWD/pty 9600 192.168.7.1:192.168.7.10 ms-dns 8.8.4.4 ms-dns 8.8.8.8 connect "echo '{\"type\":\"serial\",\"device\":\"uart1\",\"stopOnHalt\":false,\"overrun\":false}'" nodetach debug local persist silent noproxyarp noauth
18+
sudo pppd $PWD/pty 9600 192.168.7.1:192.168.7.10 ms-dns 8.8.4.4 ms-dns 8.8.8.8 connect "echo '{\"type\":\"serial\",\"device\":\"uart1\"}'" nodetach debug local persist silent noproxyarp noauth
2019
```
2120

2221
- Build and flash this program to mlogv32, then start the processor.

rust/examples/webserver/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Runs a simple webserver using [Embassy](https://embassy.dev/) and [picoserve](ht
2222
noproxyarp
2323
noauth
2424
socket 127.0.0.1:5000
25-
connect "echo '{\"type\":\"serial\",\"device\":\"uart1\",\"stopOnHalt\":false,\"overrun\":false}'"
25+
connect "echo '{\"type\":\"serial\",\"device\":\"uart1\"}'"
2626
```
2727

2828
- Run each of these commands in separate terminals (tested on WSL2 with [mirrored mode networking](https://learn.microsoft.com/en-us/windows/wsl/networking#mirrored-mode-networking)):

0 commit comments

Comments
 (0)