libs
avr32_lib has a lot of very aleph specific stuff in it.
for sure, lots of stuff for hardware that modules don’t have:
- encoders
- screen
- filesystem (sdcard and FAT)
- blackfin
- heap management
the stuff that is common has already been factored out by @tehn when he made skeleton in the first place:
- timers (hardware-agnostic)
- event queue (hardware-agnostic)
- interrupt setup (requires some tweaking for hardware)
- i2c setup
- ADC driver (AD7923)
- USB host drivers
(init.c could stand some refactoring IMO.)
teletype has a screen, so screen, region, and font got re-added to system.
TT also adds a filesystem stuff, but pulls the FAT library from the ASF and also the USB MSC host driver, doesn’t need an sdcard driver.
i also see memory module in TT but it doesn’t seem to do anything because it doesn’t have a heap.
so… i definitely see the reworked structure as having, by necessity, a couple layers:
- stuff that is literally the same for every device (e.g. soft timer and event queue, some peripheral drivers)
- code modules that are completley hardware dependent (e.g. blackfin communication)
- stuff that can be slightly tweaked in headers or preprocesser (e.g. board conf, maybe event types)
- differences best addressed at the makefile (e.g. which MCU-specific ASF components to pull in)
my main goal for wanting to do this in the first place (besides just tidiness) is so that improvements and additions can be more easily propogated between codebases. for example, the TT/system codebase takes the aleph lib and adds keyboard parsing, i2c communication with monome modules, mass storage USB driver, and maybe a better FAT library. aleph would benefit just as well from all these things and become a more useful tool for interacting with monome modular systems, etc.
finally i’ll point out that just because a code module is in the library folder doesn’t mean that it has to be included all the time. an example: screen handling stuff is not board-specific, it can stay in the lib, and of course builds targeting a screen-less device won’t use it. if we come up with a way to make a buffer refresh take half the time (by optimizing the copy/invert/pack buffer step) then TT and aleph should benefit equally without copy-pasting.
ops
op_add -> net_protected -> net -> everything
for sure, whatever non-bees framework uses the operators will need to supply some things. the operator code itself really just needs net_activate() i think, which is the routine that updates an op output. and there are some operator types that communicate with peripherals (grid/arc, midi, HID, serial, screen drawing.) the app needs to know what ops of those types exist and arbitrate between those ops and the drivers.
but statically instantiating operators and hardcoding their connections will be much, much simpler than what bees does. much of the complexity in net, net_protected etc becomes irrelevant without the need to dynamically edit the graph, save/restore the graph, manage presets, and deal with the DSP. (it’s a pretty huge mess that could use a makeover anyways.)
i’ll try and quickly put together something showing what a really bare-bones version might look like.