mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +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;
|
||||
uint32_t div = 2;
|
||||
#if ENABLE_DEBUG && defined(MODULE_XTIMER)
|
||||
uint32_t diff = xtimer_now_usec();
|
||||
#endif
|
||||
do {
|
||||
uint8_t 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();
|
||||
#endif
|
||||
} 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)
|
||||
|
Loading…
Reference in New Issue
Block a user