blob: 537b2e5e09f16fa182131671dfc4e0ed6b035ad7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <survive.h>
#include <os_generic.h>
#include <DrawFunctions.h>
struct SurviveContext * ctx;
int main()
{
int magicon = 0;
double Start = OGGetAbsoluteTime();
ctx = survive_init( );
if( !ctx )
{
fprintf( stderr, "Fatal. Could not start\n" );
return 1;
}
while(survive_poll(ctx) == 0)
{
double Now = OGGetAbsoluteTime();
if( Now > (Start+1) && !magicon )
{
survive_usb_send_magic(ctx,1);
magicon = 1;
}
//Do stuff.
}
}
|