How time flies … (and there’s a reason: we’ve moved to a new apartment).
I’ve started working on JeeH again (which is now at version 7). There have been several substantial changes, affecting all parts of the project:
-
The multi-tasker is now event-based. There is a single stack, where higher-priority tasks can interrupt and preempt running code. That code is then resumed when the task is done. A task cannot suspend itself, it can only run to completion (read: “return”). In a way, this design feels more like event-based programming than multi-threading, but with immediate IRQ handling.
-
All I/O goes through an
ioRequest()
method, which takes an array ofIoReq
structs and processes each one in sequence. This solves the way I2C works with “restarts”, i.e. performing a read right after a write, while still supporting an (optional) asynchronous model. -
The
Dev
type wraps driver requests and deals with I2C addressing and SPI bus select pins. It also addsread()
,readReg16()
,write()
, etc wrappers for easy access to registers and for configuring attached I2C and SPI devices. -
The same
ioRequest
mechanism is also used by UART drivers.
A brand new feature I’m working on: running device drivers on the host for sensors, displays, etc: anything attached to the µC via an I2C or SPI bus. The µC uses a “bridger” application for this: it accepts requests from the host PC over serial, performs each request, and sends back the results. This speeds up the development of µC-specific device drivers by omitting all cross-compiles and uploads-to-flash. It’s not ready yet, but initial results show that this is feasible (and indeed much faster).
There are also a few other major JeeH design and API changes in the pipeline.
Anyway, I’m very happy to get back to hacking on JeeH …