diff options
author | cnlohr <lohr85@gmail.com> | 2016-12-02 01:23:59 -0500 |
---|---|---|
committer | cnlohr <lohr85@gmail.com> | 2016-12-02 01:23:59 -0500 |
commit | eb7a93cefc958421d3bebbedc1163c73ae2e2778 (patch) | |
tree | 8948ebd2508404aa4cadaea431e0fb960d3f4d0c /src/survive.c | |
parent | 6c247285514fd5ae3d7497871aba5beaaa832243 (diff) | |
download | libsurvive-eb7a93cefc958421d3bebbedc1163c73ae2e2778.tar.gz libsurvive-eb7a93cefc958421d3bebbedc1163c73ae2e2778.tar.bz2 |
Update: Reading almost everything!
Diffstat (limited to 'src/survive.c')
-rw-r--r-- | src/survive.c | 19 |
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; } |