Browse Source

AP_FlashIface: fix comments and correct ms to us in vars

gps-1.3.1
Siddharth Purohit 4 years ago committed by Andrew Tridgell
parent
commit
be28a55364
  1. 4
      libraries/AP_FlashIface/AP_FlashIface.h
  2. 8
      libraries/AP_FlashIface/AP_FlashIface_Abstract.h
  3. 19
      libraries/AP_FlashIface/AP_FlashIface_JEDEC.cpp
  4. 6
      libraries/AP_FlashIface/AP_FlashIface_JEDEC.h

4
libraries/AP_FlashIface/AP_FlashIface.h

@ -12,7 +12,9 @@ @@ -12,7 +12,9 @@
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Code by Siddharth Bharat Purohit
* Code by
* Andy Piper
* Siddharth Bharat Purohit, Cubepilot Pty. Ltd.
*/
/*
Implements Common Flash Interface Driver based on

8
libraries/AP_FlashIface/AP_FlashIface_Abstract.h

@ -12,7 +12,9 @@ @@ -12,7 +12,9 @@
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Code by Siddharth Bharat Purohit
* Code by
* Andy Piper
* Siddharth Bharat Purohit, Cubepilot Pty. Ltd.
*/
/*
Implements Common frontend methods for Flash Interface Driver
@ -69,7 +71,7 @@ public: @@ -69,7 +71,7 @@ public:
* @retval true if the operation succeeded.
*
*/
virtual bool start_program_page(uint32_t page, const uint8_t *data, uint32_t &delay_ms, uint32_t &timeout_ms) = 0;
virtual bool start_program_page(uint32_t page, const uint8_t *data, uint32_t &delay_us, uint32_t &timeout_us) = 0;
/**
* @details Tries to program as much as possible starting from the offset
@ -88,7 +90,7 @@ public: @@ -88,7 +90,7 @@ public:
*
*/
virtual bool start_program_offset(uint32_t offset, const uint8_t* data, uint32_t size, uint32_t &programming,
uint32_t &delay_ms, uint32_t &timeout_ms)
uint32_t &delay_us, uint32_t &timeout_us)
{
return false;
}

19
libraries/AP_FlashIface/AP_FlashIface_JEDEC.cpp

@ -12,7 +12,9 @@ @@ -12,7 +12,9 @@
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Code by Siddharth Bharat Purohit
* Code by
* Andy Piper
* Siddharth Bharat Purohit, Cubepilot Pty. Ltd.
*/
/*
Implements Common Flash Interface Driver based on following
@ -37,7 +39,7 @@ struct supported_device { @@ -37,7 +39,7 @@ struct supported_device {
};
static const struct supported_device supported_devices[] = {
{"mt25q", 0x20, 0xBA},
{"mt25q", 0x20, 0xBA}, // https://www.mouser.in/datasheet/2/671/mict_s_a0003959700_1-2290909.pdf
{"w25q", 0xEF, 0x40}
};
@ -82,13 +84,24 @@ static const struct supported_device supported_devices[] = { @@ -82,13 +84,24 @@ static const struct supported_device supported_devices[] = {
// quad enable for winbond
#define QUAD_ENABLE_B1R2 0x4
//#define DEBUG
#ifdef HAL_BOOTLOADER_BUILD
#ifdef DEBUG
#define Debug(fmt, args ...) do {uprintf("JEDEC: " fmt "\n", ## args);} while(0)
#else
#define Debug(fmt, args ...)
#endif
#define Msg_Print(fmt, args ...) do {uprintf("JEDEC: " fmt "\n", ## args);} while(0)
#else
#ifdef DEBUG
#define Debug(fmt, args ...) do {hal.console->printf("JEDEC: " fmt "\n", ## args);} while(0)
#define Msg_Print(fmt, args ...) do {hal.console->printf("JEDEC: " fmt "\n", ## args);} while(0)
#else
#define Debug(fmt, args ...)
#endif
#define Msg_Print(fmt, args ...) do {hal.console->printf("JEDEC: " fmt "\n", ## args);} while(0)
#endif // #ifdef HAL_BOOTLOADER_BUILD
#define MAX_READ_SIZE 1024UL
#ifdef HAL_BOOTLOADER_BUILD

6
libraries/AP_FlashIface/AP_FlashIface_JEDEC.h

@ -12,7 +12,9 @@ @@ -12,7 +12,9 @@
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Code by Siddharth Bharat Purohit
* Code by
* Andy Piper
* Siddharth Bharat Purohit, Cubepilot Pty. Ltd.
*/
/*
Implements Common Flash Interface Driver based on
@ -100,7 +102,7 @@ public: @@ -100,7 +102,7 @@ public:
// Erase Methods
/**
* @details Sends command to erase the entire chips.
* @details Sends command to erase the entire chip.
*
* @param[out] delay_ms Time to wait until next is_device_busy call
* @param[out] timeout_ms Time by which the erase should have timedout

Loading…
Cancel
Save