From eb7a93cefc958421d3bebbedc1163c73ae2e2778 Mon Sep 17 00:00:00 2001 From: cnlohr Date: Fri, 2 Dec 2016 01:23:59 -0500 Subject: Update: Reading almost everything! --- src/survive.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'src/survive.c') 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 #include +#include 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; } -- cgit v1.2.3