/*..........................................................................*/ int comp_main(int argc, char *argv[]) { printf("Orthogonal Component pattern\nQEP version: %s\nQF version: %s\n" "Press 'o' to turn the Alarm ON\n" "Press 'f' to turn the Alarm OFF\n" "Press '0'..'9' to set the Alarm time\n" "Press 'a' to set the Clock in 12-hour mode\n" "Press 'b' to set the Clock in 24-hour mode\n" "Press ESC to quit...\n", QEP_getVersion(), QF_getVersion()); QF_init(); /* initialize the framework and the underlying RT kernel */ /* initialize event pools... */ QF_poolInit(l_smlPoolSto, sizeof(l_smlPoolSto), sizeof(l_smlPoolSto[0])); /* instantiate and start the active objects... */ AlarmClock_ctor(&l_alarmClock); QActive_start((QActive *)&l_alarmClock, 1, l_alarmClockQSto, Q_DIM(l_alarmClockQSto), (void *)0, 0, (QEvent *)0); QF_run(); /* run the QF application */ return 0; }
/*..........................................................................*/ int main (void) { AlarmClock_ctor(); printf("Orthogonal Component state pattern\nQP-nano version: %s\n" "Press 'o' to turn the Alarm ON\n" "Press 'f' to turn the Alarm OFF\n" "Press '0'..'9' to set the Alarm time\n" "Press 'A' to set the Clock in 12-hour mode\n" "Press 'B' to set the Clock in 24-hour mode\n" "Press ESC to quit...\n", QP_getVersion()); BSP_init(); /* initialize the board */ return QF_run(); /* transfer control to QF-nano */ }