mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
Merge pull request #13335 from bergzand/pr/mtd_spi_nor/wait_in_debug
mtd_spi_nor: Add chip wait timings to debug output
This commit is contained in:
commit
ab333f3fb2
@ -272,6 +272,9 @@ static inline void wait_for_write_complete(const mtd_spi_nor_t *dev, uint32_t us
|
|||||||
{
|
{
|
||||||
unsigned i = 0, j = 0;
|
unsigned i = 0, j = 0;
|
||||||
uint32_t div = 2;
|
uint32_t div = 2;
|
||||||
|
#if ENABLE_DEBUG && defined(MODULE_XTIMER)
|
||||||
|
uint32_t diff = xtimer_now_usec();
|
||||||
|
#endif
|
||||||
do {
|
do {
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
mtd_spi_cmd_read(dev, dev->opcode->rdsr, &status, sizeof(status));
|
mtd_spi_cmd_read(dev, dev->opcode->rdsr, &status, sizeof(status));
|
||||||
@ -304,7 +307,12 @@ static inline void wait_for_write_complete(const mtd_spi_nor_t *dev, uint32_t us
|
|||||||
thread_yield();
|
thread_yield();
|
||||||
#endif
|
#endif
|
||||||
} while (1);
|
} while (1);
|
||||||
DEBUG("wait loop %u times, yield %u times\n", i, j);
|
DEBUG("wait loop %u times, yield %u times", i, j);
|
||||||
|
#if ENABLE_DEBUG && defined(MODULE_XTIMER)
|
||||||
|
diff = xtimer_now_usec() - diff;
|
||||||
|
DEBUG(", total wait %"PRIu32"us", diff);
|
||||||
|
#endif
|
||||||
|
DEBUG("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mtd_spi_nor_init(mtd_dev_t *mtd)
|
static int mtd_spi_nor_init(mtd_dev_t *mtd)
|
||||||
|
Loading…
Reference in New Issue
Block a user