source: soft/giet_vm/hello/main.c @ 411

Last change on this file since 411 was 387, checked in by alain, 10 years ago

Cosmetic

File size: 693 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    unsigned int    procid     = giet_procid();
8    unsigned int    cluster_xy = procid/NB_PROCS_MAX;
9    unsigned int    lpid       = procid%NB_PROCS_MAX;
10    unsigned int    x          = cluster_xy >> Y_WIDTH;
11    unsigned int    y          = cluster_xy & ((1<<Y_WIDTH)-1);
12
13    giet_tty_printf( "*** Starting task hello on processor[%d,%d,%d] at cycle %d\n\n", 
14                      x, y, lpid, giet_proctime() );
15
[199]16        while (1)
[191]17        {
[295]18                giet_tty_printf(" hello world\n");
[199]19        giet_tty_getc((void*)&byte);
[387]20        if ( byte == 'q' ) giet_exit("quit command received");
[191]21        }
22} // end main
23
Note: See TracBrowser for help on using the repository browser.