Commit Graph

227 Commits

Author SHA1 Message Date
Andrew Tridgell 2990359043 PX4: Implement accurate ratiometric voltage reading on Pixhawk
this uses the monitoring of the 5V rail to compensate for changes in
the 5V reference versus the 3.3V ADC reference. It reduces the noise
on ratiometric sensors by a factor of about 6x.
2013-09-13 10:48:57 +10:00
Andrew Tridgell 3a3cecf5ff PX4: support getting servorail voltage from ORB 2013-09-12 16:28:06 +10:00
Andrew Tridgell fb56feb6b2 HAL_PX4: support all analog input pins, with scaling
this allows voltage/current/Vcc sensing on FMUv2
2013-09-12 13:26:00 +10:00
Andrew Tridgell fa107bdb58 PX4: moved UART handling to its own thread
this prevents slow writes to the SD card from interfering with MAVLink
or GPS serial communication
2013-09-04 13:15:27 +10:00
Andrew Tridgell 7082e0f8aa AP_HAL: added hold_in_bootloader parameter to scheduler->reboot() 2013-09-04 11:58:13 +10:00
Andrew Tridgell 5e33bbd197 PX4: fixed sense of relay pins 2013-08-30 15:05:29 +10:00
Andrew Tridgell 83fbb29db1 HAL_PX4: fixed example build 2013-08-30 13:01:36 +10:00
Randy Mackay 07abfc59ac AP_HAL_PX4: compile error fix 2013-08-30 13:01:35 +10:00
Randy Mackay ac36a09747 AP_HAL: add toggle to GPIO 2013-08-30 13:01:34 +10:00
Andrew Tridgell 0527bae8cb PX4: support PX4IO relay pins
this allows the pins to be used in the relay code
2013-08-30 13:01:34 +10:00
Andrew Tridgell 9b3c54fc39 PX4: ensure storage buffer is DMA aligned
this helps for boards which use DMA for FAT IO
2013-08-30 13:01:33 +10:00
Andrew Tridgell 2340bb6220 PX4: use a minimum transmit buffer for UARTs of 512 bytes
this avoids writes stalling on the GPS port. We can't afford this
memory on APM2, but we can on PX4, and it means that while the GPS is
blocking at startup it doesn't cause any scheduler slips
2013-08-30 13:01:33 +10:00
Andrew Tridgell e5f19e314d PX4: systemreset() now takes a boolean argument
this chooses whether to stay in the bootloader
2013-08-30 13:01:33 +10:00
Andrew Tridgell 4794d90bbb HAL_PX4: support up to 16 analog channels 2013-08-30 13:01:32 +10:00
Andrew Tridgell 3bc035d83a HAL_PX4: fixed GPIO build
don't use vehicle includes
2013-08-30 13:01:32 +10:00
Andrew Tridgell 0f677e3a10 HAL_PX4: fixed build on FMUv1 2013-08-30 13:01:32 +10:00
Andrew Tridgell 091b989b30 HAL_PX4: some GPIO functions are not available on FMUv2 yet 2013-08-30 13:01:32 +10:00
Julian Oes 56e94d70e9 PX4: Adaptations to latest build changes 2013-08-30 13:01:32 +10:00
Andrew Tridgell 83b13c3d88 HAL_PX4: fixed definition of relay and piezo pins 2013-07-11 13:50:23 +10:00
Andrew Tridgell 0916388ab5 HAL_PX4: retry opening UARTs up to 5 times
this seems to help a lot with the USB port on PX4
2013-07-11 13:50:23 +10:00
Marco Bauer a3b216bce3 HAL_PX4: added GPIO driver 2013-07-11 13:50:22 +10:00
Andrew Tridgell d7d87f827e HAL_PX4: support voltage monitoring on multi-connector pin 5 2013-06-05 08:24:20 +10:00
Andrew Tridgell 2316c3bd11 AP_HAL: make storage->write_block() take a const pointer 2013-06-04 14:02:13 +10:00
Andrew Tridgell e391c34d1e AP_HAL_PX4: fixed indent-tabs-mode 2013-05-30 09:54:53 +10:00
Andrew Tridgell 2c149bac8e HAL_PX4: added new arming ioctls 2013-05-16 16:43:38 +10:00
Andrew Tridgell a5b20b4dfc AP_HAL: removed scaling factor on analog sources
these are not use anymore, as voltage_average() is used instead
2013-05-13 15:29:42 +10:00
Andrew Tridgell 589b8cdb58 AP_HAL: added voltage_average_ratiometric() call to AnalogIn
this is for ratiometric sensors such as the 3DR airspeed sensor and
the Maxbotix analog sonar
2013-05-13 15:12:43 +10:00
Andrew Tridgell 172faeea26 HAL_PX4: moved rc.APM to new ROMFS directory 2013-05-10 06:16:54 +10:00
Andrew Tridgell b3e21c6add HAL_PX4: include visibility.h
needed for new nuttx structure
2013-05-10 06:16:53 +10:00
Andrew Tridgell 9cd0af1132 HAL_PX4: make PX4 snprintf support %S format
just maps it to %s for normal printf
2013-05-08 16:17:06 +10:00
Andrew Tridgell 9bc48c9894 HAL_PX4: fixed build with new AnalogIn API
pin settle times not actually implemented on PX4 yet
2013-05-03 10:09:02 +10:00
Andrew Tridgell ccd38e58a1 HAL_PX4: fixed the scaling on the analog pins 2013-05-02 21:40:15 +10:00
Randy Mackay bbbd90c430 AP_HAL: rename RCInput's valid() fn to valid_channels 2013-04-29 15:05:53 +09:00
Andrew Tridgell ec1678db83 HAL_PX4: setup for 12 output channels
moved telemetry port to /dev/ttyS2 to free PWM outputs on FMU
2013-04-25 20:10:53 +10:00
Andrew Tridgell 709615159a HAL_PX4: support 12 output channels with PX4IO
first 8 on IO board, next 4 on FMU outputs
2013-04-25 20:10:53 +10:00
Andrew Tridgell af7381e9e0 AP_HAL: added register_io_process()
this is used to register a low priority IO task. Used for file IO in
DataFlash_File.cpp
2013-04-17 21:33:50 +10:00
Andrew Tridgell d01d754ba8 HAL_PX4: if we have lost RC input then set channel 3 to 900
this allows failsafe to kick in
2013-04-15 10:52:32 +10:00
Andrew Tridgell 6ddb99a50b HAL_PX4: create APM/boot.log on SD card
useful for debugging
2013-03-21 15:05:21 +11:00
Andrew Tridgell cc932973d6 HAL_PX4: remove the need for the fmu_only flag file 2013-03-21 15:05:21 +11:00
Andrew Tridgell 8766e86091 HAL_PX4: fixed blocking bulk writes to UARTs
this fixes a problem with uBlox initialisation on PX4
2013-03-20 15:41:52 +11:00
Andrew Tridgell 14911eff6c HAL_PX4: added a (disabled) trick for handling blocking ttyACM0
this doesn't work yet, but is worth having for debugging
2013-03-20 11:20:43 +11:00
Andrew Tridgell 93fc9c48e5 HAL_PX4: fixed startup bug in fmu_only mode 2013-03-19 07:57:13 +11:00
Andrew Tridgell ac69a531d3 HAL_PX4: workaround problem with APM file on SD card
this works around file redirection bug from earlier firmwares
2013-03-18 13:12:17 +11:00
Andrew Tridgell 6a1aad30f1 HAL_PX4: auto-create APM directory on SD card 2013-03-16 19:47:09 +11:00
Andrew Tridgell b1c27407a2 AP_HAL: added voltage_average() interface to AnalogIn
returns voltage in Volts, using averaged reading over samples.

Where possible this should be auto-scaled against a known reference
voltage
2013-03-03 16:16:01 +11:00
Pat Hickey e0457f21de AP_HAL_PX4: fix off-by-one error in RCOutput channel sending 2013-02-23 15:04:17 -08:00
Andrew Tridgell c373429a6e HAL_PX4: fixed a buffer handling bug
BUF_SPACE() was badly buggy, which could lead to memory corruption
2013-02-20 18:15:56 +11:00
Andrew Tridgell 160e5fa311 HAL_PX4: show a message if we fail to upgrade PX4IO firmware 2013-02-20 18:15:23 +11:00
Andrew Tridgell 02c5c3ec4a HAL_PX4: changed scheduler priorities
put sensor priority above main sketch, to prevent occasional blocking
for sensor data
2013-02-20 11:30:54 +11:00
Andrew Tridgell 54e7bce75e HAL_PX4: cope with O_NONBLOCK not working in NuttX on ttyACM0
writes will block anyway, which clags up APM
2013-02-19 12:02:46 +11:00
Andrew Tridgell 8041768c67 HAL_PX4: perform automatic update of px4io firmware 2013-02-18 13:55:58 +11:00
Andrew Tridgell 8e2a20bea8 HAL_PX4: enable ttyACM0 as main console, ttyS1 as telemetry port 2013-02-18 13:55:33 +11:00
Andrew Tridgell e45b137816 HAL_PX4: added run_debug_shell() implementation for PX4 2013-02-07 15:04:33 +11:00
Andrew Tridgell 4fd7630ec9 HAL_PX4: IO_SET_FEATURES is not needed any more 2013-01-27 15:05:28 +11:00
Andrew Tridgell 8375abdd99 HAL_PX4: fixed max storage write size 2013-01-27 15:04:47 +11:00
Andrew Tridgell e4a204d2f6 HAL_PX4: reopen storage file on any IO error 2013-01-27 13:39:11 +11:00
Andrew Tridgell 90e264d56a HAL_PX4: disable manual override in PX4 for now 2013-01-27 12:52:14 +11:00
Andrew Tridgell 02b4ecc273 HAL_PX4: get RC input from PX4IO board
this allows us to support DSM and SBUS receivers
2013-01-27 12:52:14 +11:00
Andrew Tridgell d7409b6a25 HAL_PX4: startup in low priority to fix CLI
this ensures that tight sensor loops in setup() can run without
sleeping
2013-01-25 20:44:36 +11:00
Andrew Tridgell 7359348e2c HAL_PX4: added support for /fs/microsd/APM/nostart
prevents APM startup
2013-01-25 20:44:36 +11:00
Andrew Tridgell 8f2f4b1bc5 HAL_PX4: use write() to /dev/pwm_output for servo output
this lowest the cost of PWM output a lot, but relies on the new I2C
based IO firmware
2013-01-25 20:44:36 +11:00
Andrew Tridgell f9d43f4c3e HAL_PX4: prevent loop() overruns using hrt
this ensures if loop() takes more than 1 second, the main task gets
its priority dropped until loop() completes
2013-01-24 15:04:57 +11:00
Andrew Tridgell 70227d5d93 HAL_PX4: added scheduler performance counters 2013-01-24 15:04:57 +11:00
Andrew Tridgell 0e79b93289 HAL_PX4: added storage performance counters 2013-01-24 15:04:57 +11:00
Andrew Tridgell fc8065b50f HAL_PX4: added UART performance counters 2013-01-24 15:04:57 +11:00
Andrew Tridgell 6cf1d5e1ff HAL_PX4: handle IO errors on microsd
this should handle EINTR gracefully
2013-01-24 15:04:57 +11:00
Andrew Tridgell 966b9b9b9c HAL_PX4: format panic messages with a newline 2013-01-23 16:54:44 +11:00
Andrew Tridgell c9799fb2b7 HAL_PX4: writing more than 512 bytes at a time can cause IO errors
the vfat fs in NuttX is really very picky!
2013-01-23 16:54:44 +11:00
Andrew Tridgell 952df2fced HAL_PX4: new buffered storeage driver for microsd cards
this does all IO in the timer thread, avoids writes that don't change
data, and does all writes in multiples of 128 byte chunks. This should
be about as friendly to SD cards as we can get.
2013-01-23 16:37:40 +11:00
Andrew Tridgell f72b532405 HAL_PX4: ensure all writes go via buffers
this prevents output corruption by direct fd writes
2013-01-23 09:22:51 +11:00
Andrew Tridgell 2a10727902 HAL_PX4: run timer thread as SCHED_FIFO
this ensures it never yields to the main thread, which would break our
locking assumptions
2013-01-23 09:21:50 +11:00
Andrew Tridgell 930e79a9e1 HAL_PX4: fixed rcin->valid() for RC override input 2013-01-23 07:57:59 +11:00
Andrew Tridgell 06e63d3167 HAL_PX4: use pthread_yield() in main loop
this lowers the latency of the main loop somewhat
2013-01-23 07:36:13 +11:00
Andrew Tridgell 6e8501603c HAL_PX4: avoid RCOutput ioctl unless values change
this lowers latency somewhat
2013-01-23 07:29:59 +11:00
Andrew Tridgell 89cb3fbd61 HAL_PX4: fixed blocking IO in UART driver 2013-01-22 21:52:21 +11:00
Andrew Tridgell 6ffa18fa61 HAL_PX4: rewrite UART driver to be much more efficient
this does the IO in the timer thread, and uses buffers in the main
task to avoid system call costs in the flight code.

The cost of PX4 read and write system calls is quite high - about 10
to 15 usec. We can't afford to pay that per byte
2013-01-22 21:22:01 +11:00
Andrew Tridgell 546ed19ffc HAL_PX4: improved efficiency of serial writes
use buffer at a time writes when possible, and use O_NONBLOCKING to
avoid txspace()
2013-01-22 10:50:26 +11:00
Andrew Tridgell 18cfd29f2f HAL_PX4: added a read buffer to the UART driver
this lowers the average cost of reading bytes by a large amount, and
prevents the GPS driver from chewing lots of time.
2013-01-22 10:34:04 +11:00
Andrew Tridgell db0bd86317 HAL_PX4: name the eeprom file after the sketch
this makes it easier to switch between ArduPlane and ArduCopter
2013-01-21 22:04:17 +11:00
Andrew Tridgell 1188c9e335 HAL_PX4: added Util instance
this fixes hal.util->vsnprintf_P()
2013-01-21 17:10:42 +11:00
Andrew Tridgell 52f560a4c2 HAL_PX4: enabled AnalogIn driver 2013-01-21 13:56:57 +11:00
Andrew Tridgell ed94292c25 HAL_PX4: start adc driver in rc.APM 2013-01-21 13:55:58 +11:00
Andrew Tridgell e42cf918fd HAL_PX4: added AnalogIn driver
this allows airspeed to work on a PX4
2013-01-21 13:55:06 +11:00
Andrew Tridgell 39e28d48c2 HAL_PX4: switched scheduler to use a pthread
this allows the timer tasks to access file descriptors in the main APM
task, which makes writing PX4 device drivers much easier
2013-01-21 13:54:09 +11:00
Andrew Tridgell ffb2924dd4 HAL_PX4: added APM startup script 2013-01-21 08:27:02 +11:00
Andrew Tridgell 0655b1a925 HAL_PX4: fixed thread_running on failed startup 2013-01-20 22:13:20 +11:00
Andrew Tridgell 76092eb590 AP_HAL: remove unused peek() interface from UART drivers
this is a bit tricky to implement on some platforms, and is unused
anyway
2013-01-16 14:43:18 +11:00
Andrew Tridgell bd9c61562f HAL_PX4: added -d command line option to app
allows control of serial device
2013-01-14 16:21:27 +11:00
Andrew Tridgell 64a8a8e4c9 HAL_PX4: fixed using mavlink on the console
this disables the ONLCR termios flag, which was injecting extra
carriage returns in the output
2013-01-14 16:21:27 +11:00
Andrew Tridgell 7c7a215934 HAL_PX4: fixes for new Scheduler API 2013-01-11 12:25:26 +11:00
Andrew Tridgell 5ac23d358f HAL_PX4: update for new i2cdriver interface 2013-01-07 11:05:30 +11:00
Andrew Tridgell 319e1a4e84 HAL_PX4: support setting servo rate 2013-01-07 11:05:30 +11:00
Andrew Tridgell 30447018d5 HAL_PX4: handle %S in format strings 2013-01-05 08:10:07 +11:00
Andrew Tridgell 08d518e07f HAL_PX4: switch to libc vdprintf()
vdprintf has now been added to NuttX
2013-01-05 08:01:10 +11:00
Andrew Tridgell 84bd10d279 HAL_PX4: minor cleanups 2013-01-04 22:27:04 +11:00
Andrew Tridgell 5829d44a22 HAL_PX4: disable failsafe handler
this won't work until we can set RC output values in timers
2013-01-04 22:26:16 +11:00
Andrew Tridgell 0fcc6d7389 HAL_PX4: added an RC Output driver 2013-01-04 22:25:36 +11:00
Andrew Tridgell 44837a11f2 HAL_PX4: added baudrate support to UART driver 2013-01-04 19:42:30 +11:00
Andrew Tridgell 965fc8a9d1 HAL_PX4: enable uartB as GPS port 2013-01-04 19:41:50 +11:00
Andrew Tridgell 9f423a24ad HAL_PX4: yield CPU in delay()
this allows other apps to run
2013-01-04 12:34:35 +11:00
Andrew Tridgell 155fca8a4b HAL_PX4: make APM sketches into daemons
this also moves uartA onto UART5, allowing ttyS0 for nsh
2013-01-04 11:14:35 +11:00
Andrew Tridgell 1fc95a2d45 HAL_PX4: support PPM RC Input
HIL flying now works properly
2013-01-04 08:31:23 +11:00
Andrew Tridgell 38bccee230 HAL_PX4: initial RCInput driver (overrides only) 2013-01-03 21:30:35 +11:00
Andrew Tridgell d492b72a2c HAL_PX4: use /dev/ttyS0 for uartA
this also changes txspace and available to use FIONWRITE and FIONREAD
2013-01-03 21:12:10 +11:00
Andrew Tridgell 1e69b88261 HAL_PX4: use write() in panic()
this allows panic from the UARTDriver
2013-01-03 21:11:37 +11:00
Andrew Tridgell ac7117245a HAL_PX4: added a storage driver
stores 'eeprom' to a sdcard file
2013-01-03 19:35:05 +11:00
Andrew Tridgell b30fa6535b HAL_PX4: support reboot 2013-01-03 19:34:36 +11:00
Andrew Tridgell c6c336a6e8 HAL_PX4: implement peek() and available()
keep a 1 byte buffer
2013-01-03 17:27:53 +11:00
Andrew Tridgell cc7f4353b4 HAL_PX4: update simple example 2013-01-03 13:17:32 +11:00
Andrew Tridgell b0f1ceb76b HAL_PX4: removed some files not needed any more 2013-01-03 13:17:11 +11:00
Andrew Tridgell d9d5eb52bf HAL_PX4: use fd IO instead of stdio
this allows for hal console output from within timers, which is very
handy for debugging
2013-01-03 13:16:41 +11:00
Andrew Tridgell c6305b5876 HAL_PX4: rework Scheduler using hrt calls
thanks to Julian Oes for the suggestion
2013-01-03 13:15:57 +11:00
Andrew Tridgell 9373a4e5b3 HAL_PX4: added a uartA driver
uses stdin/stdout for IO
2013-01-03 11:03:05 +11:00
Andrew Tridgell 5053fb8acc HAL_PX4: implement atomic operations 2013-01-02 21:45:17 +11:00
Andrew Tridgell 5a70f3becf HAL_PX4: added a scheduler implementation 2013-01-02 21:39:26 +11:00
Andrew Tridgell 374af1cd14 build: change from Arduino.mk to apm.mk 2013-01-02 17:29:37 +11:00
Andrew Tridgell da10e68e87 HAL_PX4: added basic console driver (output only) 2013-01-01 18:19:18 +11:00
Andrew Tridgell b41440175f HAL_PX4: started on new PX4 HAL structures 2012-12-30 20:02:45 +11:00
Andrew Tridgell feb11f0bc9 PX4: mark example as nobuild for now 2012-12-22 14:40:10 +11:00
Pat Hickey eb530b86e8 move Arduino.mk to /mk/Arduino.mk 2012-12-20 14:52:35 +11:00
Andrew Tridgell 7d27e420ae AP_HAL: remove unnecessary Arduino.h includes 2012-12-20 14:52:30 +11:00
Andrew Tridgell c4d9b5e328 AP_HAL_PX4: added stdio.h 2012-12-20 14:51:29 +11:00
Andrew Tridgell 2669c33476 AP_HAL_PX4: added main program as include 2012-12-20 14:51:29 +11:00
Pat Hickey be00b2f681 AP_HAL_PX4: brief disclaimer 2012-12-20 14:51:28 +11:00
Pat Hickey 64a79f3598 AP_HAL_PX4: Stub Console implemented 2012-12-20 14:51:28 +11:00
Pat Hickey 2d363e0683 AP_HAL_PX4: trivial console header 2012-12-20 14:51:28 +11:00
Andrew Tridgell 471d672e54 examples: mark some examples as unable to build
some are not worth fixing. Some can't build on 1280/2560
2012-11-24 21:09:55 +11:00