diff --git a/OpenSky.config b/OpenSky.config new file mode 100644 index 0000000..8cec188 --- /dev/null +++ b/OpenSky.config @@ -0,0 +1 @@ +// ADD PREDEFINED MACROS HERE! diff --git a/OpenSky.creator b/OpenSky.creator new file mode 100644 index 0000000..e94cbbd --- /dev/null +++ b/OpenSky.creator @@ -0,0 +1 @@ +[General] diff --git a/OpenSky.creator.user b/OpenSky.creator.user new file mode 100644 index 0000000..6de9c1a --- /dev/null +++ b/OpenSky.creator.user @@ -0,0 +1,186 @@ + + + + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + true + 1 + true + 0 + true + 0 + 8 + true + 1 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + + ProjectExplorer.Project.Target.0 + + Desktop + Desktop + {cd28de33-d113-4dea-acfe-5d22386b5b7f} + 0 + 0 + 0 + + /home/ss/src/OpenSky + + + + all + + false + + + true + Make + + GenericProjectManager.GenericMakeStep + + 1 + Build + + ProjectExplorer.BuildSteps.Build + + + + + clean + + true + + + true + Make + + GenericProjectManager.GenericMakeStep + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Default + Default + GenericProjectManager.GenericBuildConfiguration + + 1 + + + 0 + Deploy + + ProjectExplorer.BuildSteps.Deploy + + 1 + Deploy locally + + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + + false + %{buildDir} + Custom Executable + + ProjectExplorer.CustomExecutableRunConfiguration + 3768 + true + false + false + false + true + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.EnvironmentId + {f0e65a16-7bc3-46b1-8d62-c90e4a8d1a9d} + + + ProjectExplorer.Project.Updater.FileVersion + 15 + + diff --git a/OpenSky.files b/OpenSky.files new file mode 100644 index 0000000..d78d946 --- /dev/null +++ b/OpenSky.files @@ -0,0 +1,37 @@ +clocksource.c +clocksource.h +config.h +delay.c +delay.h +led.h +main.c +main.h +Makefile +uart.c +uart.h +cc2500.c +cc2500.h +debug.h +frsky.h +frsky.c +storage.c +storage.h +dma.h +timeout.h +timeout.c +adc.c +dma.c +adc.h +Readme.md +wdt.h +wdt.c +static_init.h +flash.c +flash.h +ppm.h +ppm.c +apa102.c +apa102.h +soft_spi.h +soft_spi.c +portmacros.h diff --git a/OpenSky.includes b/OpenSky.includes new file mode 100644 index 0000000..945c9b4 --- /dev/null +++ b/OpenSky.includes @@ -0,0 +1 @@ +. \ No newline at end of file diff --git a/config.h b/config.h index b2e13a3..ed19493 100644 --- a/config.h +++ b/config.h @@ -1,12 +1,11 @@ #include "portmacros.h" - //pin layout ISP header #define ISP_DATA P2_1 #define ISP_CLOCK P2_2 //pin layout servo connection -#define SERVO_1 7 //P0_7 +#define SERVO_1 7 //P0_7 = BIND, pull down on startup to enter bind mode #define SERVO_2 6 //P0_6 = ADC0 #define SERVO_3 5 //P0_5 = ADC1 #define SERVO_4 4 //P0_4 = PPM OUT diff --git a/frsky.c b/frsky.c index 70e18b4..c3c1148 100644 --- a/frsky.c +++ b/frsky.c @@ -73,7 +73,7 @@ void frsky_init(void){ if (frsky_bind_jumper_set()){ //do binding - //frsky_do_bind(); + frsky_do_bind(); //binding will never return/continue } @@ -432,8 +432,14 @@ void frsky_autotune(void){ uint8_t frsky_bind_jumper_set(void){ - debug("frsky: BIND jumper set\n"); debug_flush(); - return 1; + debug("frsky: BIND jumper set = "); debug_flush(); + if (P0 & (1< no binding\n"); + return 0; + }else{ + debug("LO -> binding\n"); + return 1; + } }