add some debugging output to flash_page()

git-svn-id: https://svn.openpcd.org:2342/trunk@212 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
This commit is contained in:
laforge 2006-09-21 09:48:49 +00:00
parent be2a03b5a7
commit b0ec57cfec
1 changed files with 6 additions and 1 deletions

View File

@ -1,6 +1,7 @@
#include <sys/types.h>
#include <lib_AT91SAM7.h>
#include <AT91SAM7.h>
#include <dfu/dbgu.h>
#define EFCS_CMD_WRITE_PAGE 0x01
#define EFCS_CMD_SET_LOCK_BIT 0x02
@ -38,10 +39,14 @@ static void unlock_page(u_int16_t page)
void flash_page(u_int8_t *addr)
{
u_int16_t page = page_from_ramaddr(addr);
DEBUGP("flash_page(0x%x=%u) ", addr, page);
if (is_page_locked(page))
if (is_page_locked(page)) {
DEBUGP("unlocking ");
unlock_page(page);
}
DEBUGP("performing start_prog ");
AT91F_MC_EFC_PerformCmd(AT91C_BASE_MC, AT91C_MC_FCMD_START_PROG |
AT91C_MC_CORRECT_KEY | page);
}