Commit Graph

287 Commits

Author SHA1 Message Date
Andrew Tridgell 4fb1fdb627 HAL_AVR: added NULL uartD 2013-11-23 19:29:22 +11:00
Randy Mackay 80059d3516 AP_HAL_AVR: resolve compiler warning 2013-11-16 16:58:32 +09:00
Randy Mackay f5488bc447 HAL: MPU6k and Baro SPI to 8Mhz 2013-11-15 21:58:32 +09:00
Andrew Tridgell 08a6503364 HAL_AVR: force all devices on SPI0 to low speed when one is low speed
this forces MS5611 to low speed when MPU6K is low speed
2013-11-15 21:58:30 +09:00
Andrew Tridgell 11e1cf31c4 HAL_AVR: changed to 16 byte bulk transfer on SPI0 2013-11-07 12:48:16 +11:00
Andrew Tridgell 580e7b8a4a HAL_AVR: switch back to 500kHz SPI for MPU6k until we understand the issues
this is for new plane release. We need for analysis before we can
re-enable high speed SPI
2013-10-28 16:55:22 +11:00
Randy Mackay 443023bbbf AP_HAL: add ignore_errors to I2C driver 2013-10-21 20:01:32 +09:00
Andrew Tridgell a5788dde8f HAL_AVR: added Scheduler.set_timer_speed() support 2013-10-13 11:03:37 +09:00
Andrew Tridgell 34770fe6bf HAL_AVR: fixed SPI bus speed switching
this fixes a bug in changing the bus speed between devices
2013-10-13 11:03:17 +09:00
Randy Mackay f2f61af125 HAL_AVR: scheduler interrupt 500hz for APM2 2013-10-13 11:03:13 +09:00
Andrew Tridgell 04836ea763 HAL_AVR: set initial bus speed on MPU6k to 500kHz, then change to 8MHz
this should allow us to work even with older chips. See the MPU6000
product specification, which says max 20MHz for sensor and interrupt
regs, and max 1MHz for all other regs
2013-10-13 11:03:06 +09:00
Andrew Tridgell 4dc2f4bd58 HAL_AVR: spi3 at 8mhz for mpu6k and ms5611 2013-10-13 11:03:02 +09:00
John Arne Birkeland f6038f36bf HAL_AVR: Improved AVRTimer micros() and millis()
- More efficient code by using 16-bit timer
- micros() now has proper 1 us resolution and less overhead
- millis() has less overhead
- removed unneeded/unwanted initializatin of timers in AVRTimer::init()
2013-10-13 11:03:00 +09:00
Andrew Tridgell 5ba34b38c1 HAL_AVR: added specialised transfer functions for MPU6k and APM1 ADC
this saves quite a lot of time in interrupts
2013-10-13 11:02:57 +09:00
Andrew Tridgell ae1fd4baa4 HAL_AVR: reduce the latency of semaphore waits
this reduces the average cost of waiting for the MPU6000 semaphore
from the main loop
2013-10-10 15:41:51 +11:00
Andrew Tridgell fc7f3c8aa6 AP_HAL: fixed example build 2013-10-10 09:54:20 +11:00
Andrew Tridgell de4d505f62 HAL_AVR: fixed examples build 2013-10-05 22:03:42 +10:00
Andrew Tridgell 7072c52b57 HAL_AVR: removed Console driver 2013-10-05 18:32:12 +10:00
Andrew Tridgell 8e0a136d78 HAL_AVR: mark some examples as not building 2013-10-03 12:21:08 +10:00
Andrew Tridgell a59f505d25 HAL_AVR: implement an efficient buffer write() call for AVR
this saves some cycles in the telemetry code
2013-10-03 12:21:07 +10:00
Andrew Tridgell 6d58f5e188 HAL_AVR: updates for AP_HAL::MemberProc 2013-09-30 20:51:20 +10:00
Andrew Tridgell 0ade02a624 HAL_AVR: updates for new scheduler API 2013-09-28 21:24:02 +10:00
Andrew Tridgell 33fe27a104 AP_HAL_AVR: implement betterstream functions in AP_HAL
this gives more consistancy between ports
2013-09-22 12:21:11 +10:00
Andrew Tridgell b9d6f8e8b1 AP_HAL_AVR: removed unused script 2013-09-21 13:30:02 +10:00
Andrew Tridgell 60122f9877 AP_HAL: moved printf implementation from AP_HAL_AVR to AP_HAL
this gives a common printf implementation on all boards, which
simplifies testing, and also simplifies porting to new boards
2013-09-21 13:28:46 +10:00
Andrew Tridgell 16a0dfc38c HAL_AVR: changed to C implementation of float formatting
Many thanks to Soren Kuula for this work!
2013-09-21 11:16:08 +10:00
Andrew Tridgell a5b29f44d5 AP_HAL: added hal.gpio->usb_connected() function
this replaces the USB_MUX_PIN on APM2, and works on PX4 and FMUv2
2013-09-19 16:23:40 +10:00
Andrew Tridgell 23fc6f8aed AP_HAL_AVR: changed to AP_Vehicle.h 2013-09-13 11:45:24 +10:00
Andrew Tridgell a80d3344f5 AP_HAL_AVR: support voltage_latest() 2013-09-12 13:25:17 +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 97b7130bb9 libraries: update license header to GPLv3
we switched to GPLv3 a long time ago, but neglected to update the
per-file license headers
2013-08-30 13:01:39 +10:00
Andrew Tridgell 0bfc18b72d HAL_AVR: fixed examples build 2013-08-30 13:01:36 +10:00
Randy Mackay ac36a09747 AP_HAL: add toggle to GPIO 2013-08-30 13:01:34 +10:00
Andrew Tridgell 63873d6af3 HAL_AVR: fixed example build 2013-07-23 09:42:51 +10:00
Andrew Tridgell c691e16139 HAL_AVR: fixed example build 2013-07-18 17:36:38 +10:00
Tobias ce6529734c HAL_AVR: reorder parameters to remove a warning with -Wreorder 2013-07-08 12:07:50 +10:00
tobias 4e7fea787b HAL_AVR: corrected includes to replace #include "$HEADER" with #inlcude "utility/$HEADER"
adding -I for EVERY DIRECTORY isn't desirable

http://gcc.gnu.org/onlinedocs/cpp/Search-Path.html
2013-07-08 12:07:50 +10:00
Andrew Tridgell 25f8983383 HAL_AVR: don't initialise TWBR twice 2013-07-05 12:59:14 +10:00
Randy Mackay b16ce5e523 AVR I2C: bug fix
Fix provided by both Jason Short and lucafedechen independently
2013-06-28 07:09:05 -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 3c9d45d7d0 HAL_AVR: avoid writing bytes to EEPROM that are already correct
this speeds up writing of waypoint data, reducing latency
2013-06-04 13:33:41 +10:00
Andrew Tridgell c82caeeba1 HAL_AVR: configure analog inputs as INPUT without pullup
not all pins were defaulting to this, which led to some strange
readings on some devices. First noticed by Andi on a LM335 temperature
sensor
2013-06-01 12:19:02 +10:00
Randy Mackay ad00e0ee1e ACMotors: make test_order uint_8 2013-05-14 18:03:34 +09: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 912ed2c97c HAL_AVR: initialise settle time 2013-05-03 09:45:19 +10:00
Andrew Tridgell e7a6b12ac1 HAL_AVR: support set_stop_pin() and set_settle_time() for analogin
useful for dual sonar support
2013-05-03 09:45:19 +10:00
Randy Mackay 00146ca97d AP_HAL: fix another RCInput compile error 2013-04-29 21:27:16 +09:00
Randy Mackay e7122b85ed AP_HAL: example compile error fix 2013-04-29 17:47:04 +09:00
Randy Mackay bbbd90c430 AP_HAL: rename RCInput's valid() fn to valid_channels 2013-04-29 15:05:53 +09:00
Randy Mackay a28c6df611 RCInput: allow ppmsum of less than 8 channels 2013-04-29 14:35:59 +09:00
Andrew Tridgell 5f1bd1a452 HAL_AVR: constrain Vcc used in voltage_average()
this ensures a bad Vcc reading doesn't throw off analog inputs too
much
2013-04-22 11:36:00 +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 eb6c66af7e AP_HAL: added gpio->analogPinToDigitalPin() API 2013-03-22 12:31:14 +11:00
Andrew Tridgell a6b21443c4 HAL_AVR: fixed null termination of vsnprintf() 2013-03-22 11:53:24 +11:00
Andrew Tridgell ba8ba36af4 HAL_AVR: fixed build.Examples in autotest 2013-03-18 14:01:21 +11:00
John Arne Birkeland 9487eb6c1b Examples: Improved compatibility with Mission Planner serial terminal (CLI) 2013-03-09 15:02:56 +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
John Arne Birkeland fc566096de AVR HAL: RCJitterTest example
Used to test jitter on the PPM R/C input system.
2013-03-01 23:38:30 +09:00
Andrew Tridgell a3ef58ac92 AP_HAL: moved AnalogIn example to generic examples
it is not AVR specific anymore
2013-02-22 12:50:47 +11:00
Andrew Tridgell 5b92c67286 HAL_AVR: fixed analog input with high channel numbers 2013-02-22 12:48:54 +11:00
Andrew Tridgell fae396e64f HAL_AVR: expand analog input test to more channels 2013-02-22 12:48:29 +11:00
Andrew Tridgell 70f7cde9b8 AP_HAL: added run_debug_shell() hal.util method 2013-02-07 15:04:33 +11:00
Andrew Tridgell db8da71f65 Revert "AP_HAL_AVR: Improved AVRTimer micros() and millis()"
This reverts commit 527dcdf3b9.

This was causing the MPU6000 startup code to fail, due to time running
backwards.
2013-02-03 21:32:22 +11:00
John Arne Birkeland 527dcdf3b9 AP_HAL_AVR: Improved AVRTimer micros() and millis()
- More efficient code by using 16-bit timer
- micros() now has proper 1 us resolution and less overhead
- millis() has less overhead
- removed unneeded/unwanted initializatin of timers in AVRTimer::init()

pull request 62, approved and merged by pat
2013-02-01 09:32:40 -08: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 e852d6300f AP_HAL_AVR: fixed multi-channel RC output 2013-01-16 14:21:55 +11:00
Andrew Tridgell a3556c8cf8 HAL_AVR: fixed example build 2013-01-14 07:03:25 +11:00
Andrew Tridgell b5b7fd2f9a HAL_AVR: added bulk transfer() method
this is quite a lot faster than the byte at a time method
2013-01-13 17:31:42 +11:00
Andrew Tridgell 2fe4656a50 Merge pull request #4 from GaloisInc/master
Thanks Pat!
2013-01-10 17:24:59 -08:00
Andrew Tridgell 6aecdb3d7d HAL_AVR: tweak the default serial buffer sizes
this reduces memory fragmentation a lot, saving memory
2013-01-11 11:16:09 +11:00
Andrew Tridgell 0cb8192861 HAL_AVR: ensure we can handle a 256 size buffer 2013-01-11 10:32:52 +11:00
Andrew Tridgell cf04935438 HAL_AVR: make Console a direct wrapper of uartA
this saves a bunch of memory, and we don't really need separate
console support on AVR
2013-01-11 10:23:51 +11:00
Pat Hickey 2b621dc579 AP_HAL_AVR: main calls system_initialized 2013-01-10 14:36:53 -08:00
Pat Hickey 930a789b25 AP_HAL_AVR: Implement new scheduler methods 2013-01-10 14:07:43 -08:00
Andrew Tridgell 130aaae168 HAL_AVR: switched to 8 bit mask
max buffer size is now 256. This makes serial faster
2013-01-10 16:29:34 +11:00
Pat Hickey 59365f1b90 AP_HAL_AVR: UARTDriver guard needs AP_HAL_Boards.h 2013-01-09 13:32:13 -08:00
Andrew Tridgell 8e1bee3a5e HAL_AVR: make _taken volatile 2013-01-09 20:33:37 +11:00
Andrew Tridgell 7f20f720e8 HAL_AVR: started I2C in high speed mode
this speeds up the compass a lot
2013-01-08 14:37:39 -08:00
Pat Hickey 0660873fa7 AP_HAL_AVR: pull-up UART RX lines to fix GPS spoofing (Tridge)
Tridge discovered this bugfix:
https://groups.google.com/d/topic/drones-discuss/aek6LJeYQo8/discussion
2013-01-05 21:03:02 -08:00
Pat Hickey 4c31cc0c2b AP_HAL_AVR: add semaphore to I2CDriver 2013-01-04 16:19:38 -08:00
Pat Hickey 688ec864dc AP_HAL_AVR: deprecate begin/end atomic, timer procs run on resume 2013-01-03 17:33:14 -08:00
Pat Hickey 2d6b649aa4 AP_HAL_AVR: Semaphore unit test 2013-01-03 13:48:07 -08:00
Pat Hickey 0029148b3a AP_HAL_AVR: Implements new Semaphore interface 2013-01-03 13:48:07 -08:00
Pat Hickey 74e2ba2168 AP_HAL_AVR Scheduler: _in_timer_proc is volatile protected
* and AVRSemaphore is a friend, so it can read _in_timer_proc
  to know the current context.
2013-01-03 13:48:07 -08:00
Andrew Tridgell e729a8b277 AP_HAL: rename Semaphores cpp file to match header 2013-01-03 21:36:48 +11:00
Andrew Tridgell e25e500516 AP_HAL: fixed SPI3 Semaphores.h 2013-01-02 21:07:25 +11:00
Andrew Tridgell a3c26d44e4 AP_HAL: rename Sempahore.h to Semaphores.h
this is needed to allow build on MacOS, as its case-insensitive
filesystem picks up the NuttX semaphore.h
2013-01-02 18:22:13 +11:00
Andrew Tridgell 374af1cd14 build: change from Arduino.mk to apm.mk 2013-01-02 17:29:37 +11:00
Andrew Tridgell 8d901b3f5a HAL_AVR: fixed a warning 2013-01-02 10:19:28 +11:00
Andrew Tridgell 18581d0220 HAL_AVR: change order of CS pin init - fixes APM2 boot problem
We now init the MPU6k CS pin before the MS5611 CS pin. This should not
matter at all, but it turns out that it solves the APM2 boot
problem. We should investigate why, as this may indicate an electrical
problem.

Pair-Programmed-With: Pat Hickey
2013-01-02 08:55:47 +11:00
Andrew Tridgell 24a291cf66 HAL_AVR: only build on APM boards 2012-12-30 20:02:45 +11:00
Pat Hickey 563ca3f79b AP_HAL_AVR: expose gpio pin 70 for mpu6000 interrupt input 2012-12-22 09:11:14 +11:00
Andrew Tridgell 93040e5725 AP_HAL: removed the defer_timer_process() function
this is now unused
2012-12-21 20:01:42 +11:00
Andrew Tridgell 47358929e2 HAL_AVR: fixed attach_interrupt race condition 2012-12-21 19:33:57 +11:00
Andrew Tridgell 60d3df50ae AP_HAL: changed delay() to take a uint16_t
this allows for up to 32 second delays, and saves a bit of flash space
2012-12-20 14:53:23 +11:00
Pat Hickey 1ed6a49a7a AP_HAL_AVR: implementation for each BetterStream vprintf
* had to rename the utility vprintf function calls to print_vprintf
  to make the naming work.
2012-12-20 14:53:22 +11:00
Pat Hickey 5ab4e57673 AP_HAL_AVR: rename vprintf function to print_vprintf
* because it takes an AP_HAL::Print
2012-12-20 14:53:22 +11:00
Pat Hickey 1b0bde2779 AP_HAL_AVR: rename vprintf files to print_vprintf 2012-12-20 14:53:22 +11:00
Andrew Tridgell 8a70e173a7 AP_HAL: restrict build to right board type 2012-12-20 14:53:22 +11:00