diff --git a/libraries/AP_FlashIface/AP_FlashIface.h b/libraries/AP_FlashIface/AP_FlashIface.h index 24be8af65f..aae2bf6730 100644 --- a/libraries/AP_FlashIface/AP_FlashIface.h +++ b/libraries/AP_FlashIface/AP_FlashIface.h @@ -12,7 +12,9 @@ * You should have received a copy of the GNU General Public License along * with this program. If not, see . * - * Code by Siddharth Bharat Purohit + * Code by + * Andy Piper + * Siddharth Bharat Purohit, Cubepilot Pty. Ltd. */ /* Implements Common Flash Interface Driver based on diff --git a/libraries/AP_FlashIface/AP_FlashIface_Abstract.h b/libraries/AP_FlashIface/AP_FlashIface_Abstract.h index aee26f8d86..b50cb92f3c 100644 --- a/libraries/AP_FlashIface/AP_FlashIface_Abstract.h +++ b/libraries/AP_FlashIface/AP_FlashIface_Abstract.h @@ -12,7 +12,9 @@ * You should have received a copy of the GNU General Public License along * with this program. If not, see . * - * 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: * @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: * */ 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; } diff --git a/libraries/AP_FlashIface/AP_FlashIface_JEDEC.cpp b/libraries/AP_FlashIface/AP_FlashIface_JEDEC.cpp index c8115a08a9..4f8127ca03 100644 --- a/libraries/AP_FlashIface/AP_FlashIface_JEDEC.cpp +++ b/libraries/AP_FlashIface/AP_FlashIface_JEDEC.cpp @@ -12,7 +12,9 @@ * You should have received a copy of the GNU General Public License along * with this program. If not, see . * - * 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 { }; 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[] = { // 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 diff --git a/libraries/AP_FlashIface/AP_FlashIface_JEDEC.h b/libraries/AP_FlashIface/AP_FlashIface_JEDEC.h index ce665287bd..7834eacb61 100644 --- a/libraries/AP_FlashIface/AP_FlashIface_JEDEC.h +++ b/libraries/AP_FlashIface/AP_FlashIface_JEDEC.h @@ -12,7 +12,9 @@ * You should have received a copy of the GNU General Public License along * with this program. If not, see . * - * 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: // 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