aboutsummaryrefslogtreecommitdiff
path: root/calibrate.c
diff options
context:
space:
mode:
authorultramn <dchapm2@umbc.edu>2017-03-02 19:55:54 -0800
committerultramn <dchapm2@umbc.edu>2017-03-02 19:55:54 -0800
commita59f42935a7472da7b9f162a68b3c55aff128f7e (patch)
treee4bf6314161bbabbde6064d8b7fdb9335a764ca6 /calibrate.c
parent1c131c03fe8c5d5ab17193c9f6e7e79d81110d52 (diff)
parent9d1b1d09ed51344c8ca7b4f0a94f5841ee2c509e (diff)
downloadlibsurvive-a59f42935a7472da7b9f162a68b3c55aff128f7e.tar.gz
libsurvive-a59f42935a7472da7b9f162a68b3c55aff128f7e.tar.bz2
Merge branch 'master' of https://github.com/cnlohr/libsurvive
Diffstat (limited to 'calibrate.c')
-rw-r--r--calibrate.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/calibrate.c b/calibrate.c
index 60f4316..a04c269 100644
--- a/calibrate.c
+++ b/calibrate.c
@@ -7,8 +7,11 @@
#include <survive.h>
#include <string.h>
#include <os_generic.h>
+#include "src/survive_cal.h"
#include <DrawFunctions.h>
+#include "src/survive_config.h"
+
struct SurviveContext * ctx;
void HandleKey( int keycode, int bDown )
@@ -17,11 +20,11 @@ void HandleKey( int keycode, int bDown )
if( keycode == 'O' || keycode == 'o' )
{
- survive_usb_send_magic(ctx,1);
+ survive_send_magic(ctx,1,0,0);
}
if( keycode == 'F' || keycode == 'f' )
{
- survive_usb_send_magic(ctx,0);
+ survive_send_magic(ctx,0,0,0);
}
}
@@ -39,6 +42,7 @@ int buffertimeto[32*3];
void my_light_process( struct SurviveObject * so, int sensor_id, int acode, int timeinsweep, uint32_t timecode, uint32_t length )
{
+// if( timeinsweep < 0 ) return;
survive_default_light_process( so, sensor_id, acode, timeinsweep, timecode, length );
if( acode == -1 ) return;
@@ -94,6 +98,10 @@ void my_angle_process( struct SurviveObject * so, int sensor_id, int acode, uint
void * GuiThread( void * v )
{
short screenx, screeny;
+ CNFGBGColor = 0x000000;
+ CNFGDialogColor = 0x444444;
+ CNFGSetup( "Survive GUI Debug", 640, 480 );
+
while(1)
{
CNFGHandleInput();
@@ -139,7 +147,8 @@ void * GuiThread( void * v )
int main()
{
- ctx = survive_init( );
+ ctx = survive_init( 0 );
+ config_init();
survive_install_light_fn( ctx, my_light_process );
survive_install_imu_fn( ctx, my_imu_process );
@@ -147,9 +156,6 @@ int main()
survive_cal_install( ctx );
- CNFGBGColor = 0x000000;
- CNFGDialogColor = 0x444444;
- CNFGSetup( "Survive GUI Debug", 640, 480 );
OGCreateThread( GuiThread, 0 );
@@ -163,5 +169,6 @@ int main()
{
//Do stuff.
}
+ printf( "Returned\n" );
}