Firmware: Initial Version (Driven By Interrupts)#

Observations#

  • Interrupts are nested

  • 7 beats 42 and timer

  • All logic is in ISRs

    • Reading GPIO state is fine

    • SPI flash write is not (adds more interrupts)

    • Network/CAN IO is not (adds even more interrupts)

Demo: tmux Layout, Initialization, Startup#

For your orientation: an explanation of the terminal screen layout that is used throughout the course.

../../../../../../../_images/tmux.jpg
  • Left: application

    $ export PATH=$HOME/My-Builds/jfasch-home-x86_64/trainings/material/soup/linux/why/why-os/shell:$PATH
    $ why-shell ./why-temperature-controller-bare-metal-initial      # or whatever program
    
  • Right 1: “Plant Management”

    Set all to “off”#
    $ cd /tmp/plant
    $ echo 10 > temperature
    $ echo 0 > cooling
    $ echo 0 > soft-alarm
    $ echo 0 > hard-alarm
    
  • Right 2: Later (CAN-Bus)

  • Right 3: Cooling switch

    $ cd /tmp/plant
    $ watch cat cooling
    
  • Right 4: Soft alarm

    $ cd /tmp/plant
    $ watch cat soft-alarm
    
  • Right 5: Hard alarm

    $ cd /tmp/plant
    $ watch cat hard-alarm
    

Demo: Switch On Cooling#

  • Right 1: Set temperature above “thermostat high”

    $ echo 500001 > temperature
    
  • ⟶ cooling on

Demo: Enter Soft Alarm#

  • Right 1: Set temperature above “soft critical”

    $ echo 1000001 > temperature
    
  • ⟶ soft alarm on (cooling remains on)

Demo: Operator Intervention#

  • Left: inject “operator button” IRQ

    > irq 42
    
  • ⟶ soft alarm off (cooling remains on)

Demo: Sensor Burning#

  • Left: inject “sensor burning” IRQ

    > irq 7
    
  • ⟶ hard alarm on, cooling off