source: soft/giet_vm/applications/hello/main.c @ 661

Last change on this file since 661 was 432, checked in by alain, 10 years ago

1) Introduce the "applications" directory.
2) Introduce the fixed format (X_WIDTH / Y_WIDTH / P_WIDTH) for processor index in all applications.

File size: 559 bytes
RevLine 
[191]1#include "stdio.h"
[295]2#include "hard_config.h"
[191]3
4__attribute__((constructor)) void main()
5{
6        char                byte;
[295]7
[432]8    // get processor identifiers
9    unsigned int    x;
10    unsigned int    y;
11    unsigned int    lpid;
12    giet_proc_xyp( &x, &y, &lpid );
13
[295]14    giet_tty_printf( "*** Starting task hello on processor[%d,%d,%d] at cycle %d\n\n", 
15                      x, y, lpid, giet_proctime() );
16
[199]17        while (1)
[191]18        {
[295]19                giet_tty_printf(" hello world\n");
[199]20        giet_tty_getc((void*)&byte);
[387]21        if ( byte == 'q' ) giet_exit("quit command received");
[191]22        }
23} // end main
24
Note: See TracBrowser for help on using the repository browser.