aboutsummaryrefslogtreecommitdiff
path: root/src/survive.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/survive.c')
-rw-r--r--src/survive.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/survive.c b/src/survive.c
index 97493a0..751cc01 100644
--- a/src/survive.c
+++ b/src/survive.c
@@ -2,20 +2,35 @@
#include "survive_internal.h"
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
struct SurviveContext * survive_init( void(*ff)( struct SurviveContext * ctx, const char * fault ), void(*notefunction)( struct SurviveContext * ctx, const char * note ) )
{
int r = 0;
struct SurviveContext * ret = calloc( 1, sizeof( struct SurviveContext ) );
+
+ ret->headset.sensors = 32;
+ ret->headset.ctx = ret;
+ memcpy( ret->headset.codename, "HED", 4 );
+
+ ret->watchman[0].sensors = 16;
+ ret->watchman[0].ctx = ret;
+ memcpy( ret->watchman[0].codename, "CT0", 4 );
+
+ ret->watchman[1].sensors = 16;
+ ret->watchman[1].ctx = ret;
+ memcpy( ret->watchman[1].codename, "CT1", 4 );
+
+
ret->faultfunction = ff;
ret->notefunction = notefunction;
+
+ //USB must happen last.
if( r = survive_usb_init( ret ) )
{
return 0;
}
- ret->headset.sensors = 32;
- ret->headset.ctx = ret;
//ret->headset->photos = malloc( ret->headset->sensors * sizeof(struct SurvivePhoto) );
return ret;
}