Commit Graph

29 Commits

Author SHA1 Message Date
Allen Hill c24bab7a80 Migrate to FreeRTOS 2026-09-28 11:36:01 -07:00
Allen Hill 5b9cb1da8b Add single byte send debug function 2026-09-20 15:08:19 -07:00
Allen Hill fbf5811496 Refine (further) the Phy API
- Refactor send/read data to read entire array instead of byte-oriented
  reads
- Simplify/improve consistency of asynchrony (all send functions now
  optionally async)
- Fix start-bit TX (now actually validate joinable start-bits)

Assisted-by: Claude Code (Opus 5)
2026-09-20 15:08:15 -07:00
Allen Hill 6b22f14e6d Fix deafen semantics 2026-09-20 15:08:15 -07:00
Allen Hill 2c85305c0d Finish Pico/PIO phy layer
Assisted-by: Claude Code (Opus 5)
2026-09-20 15:08:11 -07:00
Allen Hill 8a47b5b776 Refactor peripheral/bus/phy APIs (prep for pico/PIO)
- Refactor PHY to be higher-level with a field focus (controller/peripheral address,
  control byte, etc)
  - Phy layer is now device address aware (ACK's automatically) (Hardens
    previously ~implicit design to only support emulating one AVCLAN
    unit per mockingboard build)
- Redesign `phy_active` => `phy_frame_pending` (to allow
  asynchronous/buffered frame reads on pico) and embed within
  Peripheral::read
- Add `deafen` function: like mute, but also ignore incoming messages (i.e.
  don't receive/process at all). Makes `Bus::is_active` always return
  `false`.
- Add debug bus driving functions

Assisted-by: Claude Code (Opus 5)
2026-09-20 15:07:42 -07:00
Allen Hill 53c5abb3e9 Fix compile errors due to non-portable code 2026-09-03 16:07:27 -07:00
Allen Hill cd68ee7267 misc infra/clangd updates 2026-08-13 17:55:46 -07:00
Allen Hill 7871e92dbe Fix Debug builds 2026-07-31 17:53:31 -07:00
Allen Hill a99fe56aae Fix intermittent, early boot short start bit errors 2026-07-21 13:22:19 -07:00
Allen Hill 909915730b Not all error conditions print a message 2026-07-21 12:52:25 -07:00
Allen Hill 56936aed10 Switch to using references where possible 2026-07-17 14:31:54 -07:00
Allen Hill 5208e083f3 Redesign (simplify) top-level avclan interface to use expected/nullable unique_ptr
- Peripheral::read/send now return `expected<unique_ptr<Frame>, Error>`
for a unified success/error interface.
- Peripheral::route returns `expected<unique_ptr<Frame>, Error>` to
distinguish intent: (intentional) non-response vs unable to respond
- Other functions with optional message semantics (handle,poll,react)
return a unique_ptr whose ownership-state indicates response intent
(i.e. send new message)

Bundled necessary changes:
- Switch Frame allocation from global to local (enabled via member
  function new/delete)
- Add new header-library tl::expected to shim avr-libstdcpp

Unrelated: Defensive `continue` added after `route`, to reduce Bus
activity check latency

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-17 14:47:47 -07:00
Allen Hill 82884c1305 Resolve some const/static-able warnings
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 14:16:38 -07:00
Allen Hill b194a6df2c Improve/expand C phy docs 2026-07-08 13:51:38 -07:00
Allen Hill 2ed6066609 Fix miscellaneous bugs identified by Claude
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 13:15:59 -07:00
Allen Hill e50bde197d Complete the switch to jnk0le uart lib
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 12:49:01 -07:00
Allen Hill 0664c1e7bd Fix broadcasting messages and revert Playback_Status reports to broadcast 2026-07-06 20:28:59 -07:00
Allen Hill 9fd8c5636e Finalize C <=> C++ interface 2026-07-06 19:39:49 -07:00
Allen Hill 1c0124edcc Shift avclan_bit_t to avclan.h 2026-07-06 13:55:13 -07:00
Allen Hill a0c6601cda Unify Send/Read error enums 2026-07-06 13:36:53 -07:00
Allen Hill 04c492271c fixup error switch flow 2026-07-06 11:31:36 -07:00
Allen Hill 30ad2dc67f fixup bus send/read parity & acking 2026-07-06 11:31:17 -07:00
Allen Hill 1fdd296784 Ref shouldACK in lambda to only set once 2026-07-05 19:40:48 -07:00
Allen Hill 1e416a3457 Misc clang-tidy/comment tweaks 2026-07-05 19:40:17 -07:00
Allen Hill 950e1e8094 Shift some bus functions definitions out of the header 2026-07-05 19:37:40 -07:00
Allen Hill e878a61313 Port Frame object to C++ 2026-07-05 19:35:58 -07:00
Allen Hill 66bbf8639e Parameterise Peripheral by its Devices and add CDChanger as one 2026-06-27 10:29:34 -07:00
Allen Hill d98cc8acad Add C++ Bus class for the physical layer interface 2026-06-25 20:40:10 -07:00