MF_DBGLEVEL => DBGLEVEL (pm3 side)

This commit is contained in:
Philippe Teuwen 2019-06-06 10:05:09 +02:00
commit 4761ea13f7
21 changed files with 329 additions and 338 deletions

View file

@ -149,7 +149,7 @@ void FlashStop(void) {
// SPI disable
AT91C_BASE_SPI->SPI_CR = AT91C_SPI_SPIDIS;
if (MF_DBGLEVEL > 3) Dbprintf("FlashStop");
if (DBGLEVEL > 3) Dbprintf("FlashStop");
StopTicks();
}
@ -189,7 +189,7 @@ bool Flash_CheckBusy(uint32_t timeout) {
StartCountUS();
uint32_t _time = GetCountUS();
if (MF_DBGLEVEL > 3) Dbprintf("Checkbusy in...");
if (DBGLEVEL > 3) Dbprintf("Checkbusy in...");
do {
if (!(Flash_ReadStat1() & BUSY)) {
@ -218,7 +218,7 @@ uint8_t Flash_ReadID(void) {
uint8_t man_id = FlashSendByte(0xFF);
uint8_t dev_id = FlashSendLastByte(0xFF);
if (MF_DBGLEVEL > 3) Dbprintf("Flash ReadID | Man ID %02x | Device ID %02x", man_id, dev_id);
if (DBGLEVEL > 3) Dbprintf("Flash ReadID | Man ID %02x | Device ID %02x", man_id, dev_id);
if ((man_id == WINBOND_MANID) && (dev_id == WINBOND_DEVID))
return dev_id;
@ -325,7 +325,7 @@ uint16_t Flash_WriteData(uint32_t address, uint8_t *in, uint16_t len) {
}
if (!FlashInit()) {
if (MF_DBGLEVEL > 3) Dbprintf("Flash_WriteData init fail");
if (DBGLEVEL > 3) Dbprintf("Flash_WriteData init fail");
return 0;
}
@ -415,7 +415,7 @@ out:
bool Flash_WipeMemoryPage(uint8_t page) {
if (!FlashInit()) {
if (MF_DBGLEVEL > 3) Dbprintf("Flash_WriteData init fail");
if (DBGLEVEL > 3) Dbprintf("Flash_WriteData init fail");
return false;
}
Flash_ReadStat1();
@ -431,7 +431,7 @@ bool Flash_WipeMemoryPage(uint8_t page) {
// Wipes flash memory completely, fills with 0xFF
bool Flash_WipeMemory() {
if (!FlashInit()) {
if (MF_DBGLEVEL > 3) Dbprintf("Flash_WriteData init fail");
if (DBGLEVEL > 3) Dbprintf("Flash_WriteData init fail");
return false;
}
Flash_ReadStat1();
@ -458,7 +458,7 @@ bool Flash_WipeMemory() {
// enable the flash write
void Flash_WriteEnable() {
FlashSendLastByte(WRITEENABLE);
if (MF_DBGLEVEL > 3) Dbprintf("Flash Write enabled");
if (DBGLEVEL > 3) Dbprintf("Flash Write enabled");
}
// erase 4K at one time
@ -479,7 +479,7 @@ bool Flash_Erase4k(uint8_t block, uint8_t sector) {
// execution time: 0,3s / 300ms
bool Flash_Erase32k(uint32_t address) {
if (address & (32*1024 - 1)) {
if ( MF_DBGLEVEL > 1 ) Dbprintf("Flash_Erase32k : Address is not align at 4096");
if ( DBGLEVEL > 1 ) Dbprintf("Flash_Erase32k : Address is not align at 4096");
return false;
}
FlashSendByte(BLOCK32ERASE);