Commit Graph

72 Commits

Author SHA1 Message Date
Andrew Tridgell
a1187519a8 AP_HAL: use AP_HAL_BOARD_DRIVER in remaining test sketches 2012-12-20 14:52:37 +11:00
Pat Hickey
eb530b86e8 move Arduino.mk to /mk/Arduino.mk 2012-12-20 14:52:35 +11:00
Andrew Tridgell
448fc6719f HAL_Empty: fixed return in dataflash 2012-12-20 14:52:33 +11:00
Pat Hickey
4c930b77a4 DataFlash_Empty defined 2012-12-20 14:52:31 +11:00
Andrew Tridgell
7d27e420ae AP_HAL: remove unnecessary Arduino.h includes 2012-12-20 14:52:30 +11:00
Andrew Tridgell
964bc56aa2 DataFlash: reinstate SITL dataflash code 2012-12-20 14:52:29 +11:00
Pat Hickey
308281f252 DataFlash_test ported to AP_HAL 2012-12-20 14:51:40 +11:00
Andrew Tridgell
c4b8959202 DataFlash: added SITL headers 2012-12-20 14:51:40 +11:00
Andrew Tridgell
e57834d763 DataFlash: added SITL header 2012-12-20 14:51:40 +11:00
Pat Hickey
7b9b088261 DataFlash: AP_HAL port fixups 2012-12-20 14:51:37 +11:00
Pat Hickey
aaffd9d96e DataFlash: APM2 ported to AP_HAL SPIDeviceDriver 2012-12-20 14:51:36 +11:00
Pat Hickey
4f07a90b2e DataFlash: apm1 fixups 2012-12-20 14:51:36 +11:00
Pat Hickey
ef1db1a3fc DataFlash: don't take a delay_cb 2012-12-20 14:51:36 +11:00
Pat Hickey
0e5ff36c6c DataFlash: DataFlash_APM1 rewritten in terms of AP_HAL spi primitives 2012-12-20 14:51:36 +11:00
Pat Hickey
a81de007d8 DataFlash: headers switch to use AP_HAL SPI device driver types 2012-12-20 14:51:36 +11:00
Pat Hickey
cc699a2a4e DataFlash: conform to ordinary stdint types
* s/unsigned char/uint8_t/g
* changed all type 'byte' to uint8_t
2012-12-20 14:51:36 +11:00
Pat Hickey
8ffec83b73 DataFlash: fixes to lib include and make the test smaller 2012-12-20 14:51:22 +11:00
Andrew Tridgell
17c115d2aa SITL: don't define __AVR_ATmega2560__ on desktop build
this allows us to properly separate the desktop build in the code
2012-11-19 09:03:35 +11:00
Jason Short
c848fe18a5 APM1 Dataflash update
My data flash would never erase, this fixed it.
2012-11-09 22:15:16 -08:00
rmackay9
17afd075c1 DataFlash_APM1: use spi_semaphore to avoid conflicts with optical flow 2012-10-18 17:03:50 +09:00
rmackay9
785d9ca6a7 DataFlash_APM2: renamed semaphore to spi3_semaphore to make it more obvious which semaphore is required. 2012-10-18 17:00:05 +09:00
Pat Hickey
aa210d7e99 AP_DataFlash_test wibble 2012-10-09 11:39:09 -07:00
Pat Hickey
605f89fa69 DataFlash_APM2: private AP_Semaphore* rather than use extern AP_Semaphore_spi3
The AP_Semaphore* argument to the constructor can be null (and is by
default for compatibility). Semaphore is only used when non-null.
2012-10-09 11:38:52 -07:00
rmackay9
b9963f5b5c DataFlash: modified to use AP_Semaphore for SPI3 bus when required.
Also fixed test sketch which seemed broken.
2012-10-06 12:41:50 +09:00
uncrustify
08c8dffd48 uncrustify libraries/DataFlash/DataFlash.h 2012-08-21 19:19:52 -07:00
uncrustify
2e97fd3e9f uncrustify libraries/DataFlash/DataFlash.cpp 2012-08-21 19:19:52 -07:00
uncrustify
9b44f5b741 uncrustify libraries/DataFlash/DataFlash_APM1.h 2012-08-21 19:04:23 -07:00
uncrustify
c68a341633 uncrustify libraries/DataFlash/DataFlash_APM2.h 2012-08-21 19:04:23 -07:00
uncrustify
21337a39d3 uncrustify libraries/DataFlash/DataFlash_APM1.cpp 2012-08-21 19:04:23 -07:00
uncrustify
eb9d6b259b uncrustify libraries/DataFlash/DataFlash_APM2.cpp 2012-08-21 19:04:23 -07:00
uncrustify
15d8ba45e3 uncrustify libraries/DataFlash/examples/DataFlash_test/DataFlash_test.pde 2012-08-21 19:04:10 -07:00
rmackay9
2b24e422de DataFlash: revert delay callbacks to use "unsigned long" 2012-08-18 20:28:31 +09:00
rmackay9
20cb2e56a0 DataFlash: change "unsigned long" to "uint32_t" in callback functions 2012-08-18 19:22:14 +09:00
rmackay9
94552b57a7 DataFlash: replaced "int" with "int16_t" 2012-08-18 18:31:20 +09:00
Andrew Tridgell
e171720608 DataFlash: fixed SITL build 2012-08-17 16:27:19 +10:00
Jason Short
bd91215770 Dataflash fix for missing card error 2012-08-16 15:37:28 -07:00
Jason Short
3ca57ac105 DataFlash : Removed Chip Erase - relying on Block erase only 2012-08-15 21:04:24 -07:00
Jason Short
ce2a608706 Dataflash Logs : Fixed block erase on APM2
Byte order for 512 vs 528 was reversed.
2012-08-15 21:04:24 -07:00
Craig Elder
6d3fdfc03a DataFlash: The current method for checking if chip erase worked is producing false positives. We are forcing the block erase until we have a deterministic test method. 2012-07-09 15:23:35 -07:00
Andrew Tridgell
dd24330645 DataFlash: fallback to BlockErase if ChipErase fails
The errata on the APM2 dataflash chip says that ChipErase may not work
on some chips
2012-07-04 12:42:46 +10:00
Andrew Tridgell
fc73fd6531 DataFlash: use ChipErase() instead of PageErase() on all pages
This makes the DataFlash erase much faster (about 6 seconds instead of
about 60 seconds).

We need to test and ensure the behaviour is equivalent apart from the
speed
2012-05-22 19:29:02 -07:00
rmackay9
c45b124cbe DataFlash_APM2 - moved CS_inactive call (which disables the dataflash) from the beginning to the end of all methods. This means the dataflash does not monopolize the SPI bus.
Also formatting changes to use tab instead of space. Sorry, should have done this as a separate check-in to the above changes.
2012-04-21 20:14:45 +09:00
Randy Mackay
ed19c25a97 Arduino 1.0 - changed all #includes of "WProgram.h", "wiring.h" and "WConstants.h to "Arduino.h".
Modified FastSerial's write function to return size_t (number of bytes written).
2012-01-28 12:25:47 +09:00
Doug Weibel
756793611f Repair dataflash test 2012-01-08 21:29:19 -07:00
Andrew Tridgell
880c7e6411 DataFlash: cope with older dataflash chips
some of the APM2 DataFlash cards use an older chip with only 4096
pages, and a density code of 6. Doug has one of these.
2012-01-04 16:16:35 +11:00
Andrew Tridgell
5e4f66e525 DataFlash: moved high level logging logic to library
this moves out all the high level logic from ArduPlane/ArduCopter to
the library. It also adds a "config page", as the last page in the
flash. This is used to check if the flash needs erasing. We only erase
now if the DF_LOGGING_FORMAT has changed.

This patch also adds a public CardInserted() method, which is used to
disable logging on APM2 if a dataflash card is not inserted
2011-12-28 16:00:48 +11:00
Andrew Tridgell
bd9488f1e4 DataFlash: fixed sense of card detect 2011-12-28 16:00:48 +11:00
Andrew Tridgell
637d4675e1 added in DataFlash.cpp
forgot this ....
2011-12-26 19:34:06 +11:00
Andrew Tridgell
977326e991 dataflash: reworked classes to move most code to parent class
this moves all the non-hardware specific code to the parent
DataFlash_Class class, keeping the hw specific code much smaller and
simpler.

This should prevent discrepancies creeping in between APM1 and APM2
support again
2011-12-26 19:17:11 +11:00
Andrew Tridgell
13b2ddcbe1 dataflash: fixed APM2 flash logging
we had log wrap disabled on APM2, and also had the wrong log size. The
mainline code assumed 4096, but it is 8192 pages long.
2011-12-26 19:17:11 +11:00