Application Control Flow; Event-Driven Architecture - Texas Instruments TI-89 Developer's Manual

Graphing calculator
Hide thumbs Also See for TI-89:
Table of Contents

Advertisement

9.

Application Control Flow

9.1.

Event-Driven Architecture

The TI AMS Operating System (OS) implements an event-driven architecture.
After initializing the system, the operating system goes into a loop checking each
hardware device for an event such as a keypress or clock tick. When a device
indicates it needs processing, the OS packages information about the event into
a message and sends it to the currently active application.
If none of the devices need attention, the window list is scanned for a dirty
window, that is to say, a window which needs to be repainted. A message (see
CM_WPAINT in section 9.3. Commands) is sent to the window's owner
application indicating it needs to repaint its window.
After all dirty windows have been redrawn, a null message (CM_NULL) is sent to
the current application. Then the calculator is put into low power idle mode. Any
hardware interrupt brings the calculator out of low power mode and starts the
event scan at the top of the loop.
An application receives messages from the OS through its main entry point. A
simplified overview of an application's main entry point follows:
#include "tiams.h"
TERecord terec;
AP_myApp(pFrame self, Event *event)
{
switch (event->command)
{
case CM_START:
.
.
.
break;
case CM_KEY_PRESS:
.
.
.
if (! TE_handleEvent(&terec, event))
break;
case CM_WPAINT:
.
.
.
break;
TI-89 / TI-92 Plus Developer Guide
EV_defaultHandler(event);
Not for Distribution
77
Beta Version January 26, 2001

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ti-92 plusTi-92 plus

Table of Contents