Change .gitattributes to prevent git from modifying lots of files from lib-mini51 because of CRLF endings.

Changes to be committed:
	modified:   .gitattributes
Include file was not found because filenames in Linux are case sensitive.

Changes to be committed:
	modified:   lib-Mini51/StdDriver/src/gpio.c
	modified:   lib-Mini51/hal/lib_i2c.c
Add Debug directory to .gitignore

Changes to be committed:
	modified:   .gitignore
Startup files:
Eclipse doesn't like assembler files. Use C startup file for MINI51 found here:
https://github.com/coocox/Mplib/blob/master/Nuvoton/Mini51/resource/mini51_coide_empty_project/cmsis_boot/startup/src/startup_Mini51Series.c

This one wants to call a SystemInit() function, so I added an empty function in system_Mini51Series.c

Changes to be committed:
	modified:   lib-Mini51/Device/Nuvoton/Mini51Series/Source/system_Mini51Series.c
	new file:   lib-Mini51/startup_Mini51Series.c
Fixed accelerometer and gyro interface for Hubsan X4.
Removed interrupt config from accelerometer initialization (interrupt line is not used).
Fixed conversion from raw data to fixedpoint representation.
Fixed axis relationship between accelerometer/gyro and the expected aircraft axes.

Changes to be committed:
	modified:   src/accelerometer.c
	modified:   src/defs.h
	modified:   src/gyro.c
Modified checkbox config:
Set armed state using AUX1, disable stick arm. Stick arm doesn't work anyway if the Hubsan transmitter is not set to full sensitivity.
Disable acro modes.
Motor off when throttle stick is low. When the X4 now gets out of control due to wrong settings I can at least make it come down again and don't have to chase it through the room.

Changes to be committed:
	modified:   src/config_X4.c
	modified:   src/config_X4.h
Changed #ifdef to recognize NO_xxx options.

Changes to be committed:
	modified:   src/imu.c
Add some conditional compilation #ifs. This way I can exclude unused files from build.
LED1 shows state of "stable" bit.
LED2 blinks if connection to transmitter is lost.
Add correct motor mixing formula for X4. The motors spin in opposite direction compared to JD385.

Changes to be committed:
	modified:   src/bradwii.c
Add linker command files for GCC

Changes to be committed:
	new file:   lib-Mini51/linker/link.ld
	new file:   lib-Mini51/linker/memory.ld
Add project files for Eclipse (with CDT and Gnuarmeclipse).
Uses internal builder (generated makefiles).
Excluded from build are:
lib-Mini51/hal/
drv_serial.c
lib_serial.c
lib_spi.c

lib-Mini51/StdDriver/
retarget.c
spi.c
uart.c

lib/*

src/
baro.c
compass.c
gps.c
navigation.c
nrf24l01.c
rx_v202.c
rx.c
serial.c

Changes to be committed:
	new file:   .cproject
	new file:   .project
Add Eclipse .settings/ dir to .gitignore

Changes to be committed:
	modified:   .gitignore
Update README to explain what I am trying to do.

Changes to be committed:
	modified:   README.md
Update current project status in README

Changes to be committed:
	modified:   README.md
Just invert the yaw PID output for H107L instead of providing a new motor mixing formula.

Changes to be committed:
	modified:   src/bradwii.c
Add links to forum

Changes to be committed:
	modified:   README.md
Add low battery voltage indicator for X4.

LEDs will start to blink while battery voltage is below threshold.
Unlike the original firmware, blinking will stop again if voltage rises
above threshold again.

LED blinking patterns:
Off during IMU calibration
Slow blink while battery voltage low
Fast blink while connection to transmitter lost.
Short blinks while not armed
On otherwise.

Voltage measurement turned out to be complicated:
ADC reference voltage is internally tied to supply voltage in Mini54.
Supply voltage is generated by LM6206 3.0V low dropout linear voltage
regulator with +/- 2% output tolerance.
Problem: even this low dropout type has max. 680mV dropout
voltage. So while flying the reference voltage might drop below 3.0V.
When the reference voltage drops together with the battery voltage, the
battery voltage cannot be measured anymore.
The internal bandgap voltage should not be influenced by this.
Unfortunately the bandgap voltage is specified with high tolerance.
Assuming that the bandgap voltage is not excatly known beforehand, but
it's at least stable, the battery voltage measurement is performed like this:

Measure initial bandgap voltage after power-on. At that time the battery is not under load
and the external reference voltage is good.
In the main loop alternatingly measure battery voltage and bandgap voltage.
Use current bandgap and initial bandgap measurements to compensate any reference
voltage changes.

On branch battery
Changes to be committed:
	new file:   lib-Mini51/hal/lib_adc.c
	new file:   lib-Mini51/hal/lib_adc.h
	modified:   src/bradwii.c
	modified:   src/bradwii.h
	modified:   src/config_X4.h
Merge remote-tracking branch 'TheLastMutt/battery'