Commit 3c94f16
committed
modem: show the waterfall while transmitting
Every radio shows you your own signal on transmit; mercury froze the display
on key-up, because the spectrum slot was fed only from the capture path.
Feed it from the transmitted burst as well. Same slot, same lock, same
sequence counter the RX path uses, so the publisher thread and the on-the-wire
spectrum frame need no change whatsoever. Only one writer is ever active --
the link is half duplex, so RX decode and TX modulation never overlap -- and
the FFT runs inline under the lock exactly as it already does for RX.
Two details that decide whether this looks right:
- Publishing once per burst would paint a single line every 3.7 s on
DATAC16. Instead it publishes from inside the drain loop that
send_modulated_data already runs while the burst plays out, indexed by
elapsed playout. The ring is filled far faster than it drains, so drain
progress -- not write progress -- is what paces the display.
- Samples are taken at modem rate, which is what g_spectrum_sample_rate
already reports, so the frequency axis matches RX and the display does not
jump scale on key-up.
Gated by g_spectrum_enabled, the switch the RX FFT already uses, so the UI
checkbox and -W turn off both directions at once: one waterfall control, one
setter. Unlike RX there is no second consumer to keep it alive -- the
channel-busy detector shares the RX FFT, but occupancy means nothing while we
are the ones occupying the channel.
The stats struct is opened lazily and TX now gets there first -- mercury sends
CALL before it has decoded anything -- so the open is done here too. Omitting
it ran the first burst of every connect over an unopened MODEM_STATS, which
hung the connect; caught by the integration suite, which is the only gate that
transmits.
Gate: unit suite green; integration 245.1 s against a 245-246 s baseline;
mercury and the embedded fyne UI both build, go vet clean.1 parent dc26a95 commit 3c94f16
2 files changed
Lines changed: 88 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
403 | 462 | | |
404 | 463 | | |
405 | 464 | | |
| |||
1157 | 1216 | | |
1158 | 1217 | | |
1159 | 1218 | | |
| 1219 | + | |
1160 | 1220 | | |
1161 | 1221 | | |
1162 | 1222 | | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
1163 | 1233 | | |
| 1234 | + | |
1164 | 1235 | | |
1165 | 1236 | | |
1166 | 1237 | | |
| |||
1171 | 1242 | | |
1172 | 1243 | | |
1173 | 1244 | | |
1174 | | - | |
| 1245 | + | |
| 1246 | + | |
1175 | 1247 | | |
1176 | | - | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
1177 | 1261 | | |
1178 | 1262 | | |
1179 | 1263 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
| 70 | + | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| |||
0 commit comments