Menu

Display system

Aljaž Srebrnič

New display system

Please reflect on the following questions:

  1. How many times per second does the clock module need to refresh the screen?
  2. How many times per second does the acceleration module need to refresh the screen?

As you have probably thought, each module needs to update the screen in regular intervals, but that interval doesn't have to necessarily be the same for each module! Having that in mind, we got rid of display flags and let modules update the screen directly. That is, consider the clock module:

  1. At every second, the RTC sends a message to the message bus.
  2. The module which is listening to the bus, catches the message and immediately updates the relevant part of the screen (hour, minute, seconds).
  3. The function exits and the watch returns to low power mode.

Well, isn't this much more simple? It also reduced the firmware size a lot, giving us space to have more modules compiled at the same time!
You might now ask, but how does the module know that it is active in the screen and will not draw over other module's displayed data? Simple! Recall that it is up to the openchronos menu to cycle between modules. So, when you cycle into a module, the menu system will actually call the corresponding _activate() function of the module.