← Back to the chapter · Previous detail

Technical detail · Firmware Architecture Patterns

Task-model threshold and greenhouse record

Stage 4: Task Model Only if Needed. If gateway communication, display update, and sensor sampling become independent blocking responsibilities, the team may move to a task model. That decision requires evidence: queue contracts, stack or memory headroom, shared-state rules, and fault behavior.

prototype=greenhouse-vent-controller
architecture_question=can the firmware expose control state and fault recovery clearly?
current_pattern=state machine with event queue
driver_boundary=temp_humidity, door, fan_relay, gateway_status
states=idle, ventilating, sensor_fault, gateway_offline, manual_override
events=timer_tick, sensor_ready, door_changed, publish_failed, override_command
normal_run=read sensors, update state, drive fan, publish status
fault_run=sensor missing, gateway unavailable, relay feedback mismatch
shared_state_rule=event queue owns input facts; state machine owns decisions
handoff=keep states, events, payload samples, and fault cases; repeat timing check on target

← Back to the chapter · Previous detail