Skip to content
Snippets Groups Projects
Unverified Commit e7b554ba authored by Martine Lenders's avatar Martine Lenders Committed by GitHub
Browse files

Merge pull request #9773 from maribu/lpc2387

cpu/lpc2387: Fixed documentation and bugs preventing use of LLVM
parents 56d79b3a f31375a1
No related branches found
No related tags found
No related merge requests found
......@@ -85,13 +85,28 @@ bool install_irq(int IntNumber, void (*HandlerAddr)(void), int Priority)
}
}
__attribute__((naked,noreturn)) void arm_reset(void)
void arm_reset(void)
{
/*
* We abuse the watchdog timer for a reset.
*/
irq_disable();
WDTC = 0x0FFFF;
WDMOD = 0x03;
WDFEED= 0xAA;
WDFEED= 0x55;
/* Set the watchdog timeout constant to 0xFFFF */
WDTC = 0xFFFF;
/*
* Enable watchdog interrupt and enable reset on watchdog timeout.
* (The reset on watchdog timeout flag is ignored, if interrupt on watchdog
* timeout is not set. Thus, we set both. The reset takes precedence over
* the interrupt, anyway.)
*/
WDMOD = 0x03;
/*
* Feed the watchdog by writing 0xAA followed by 0x55:
* Reload the watchdog timer with the value in WDTC (0xFFFF)
*/
WDFEED = 0xAA;
WDFEED = 0x55;
/* Wait for the watchdog timer to expire, thus performing a reset */
while(1) {}
}
......
......@@ -38,7 +38,7 @@ static unsigned int iap_command[5];
static unsigned int iap_result[2];
/* typedefinition for IAP entry function */
typedef void (*IAP)(unsigned int[], unsigned int[]);
IAP IAP_Entry;
static const IAP IAP_Entry = (IAP)0x7ffffff1;
/* some function prototypes */
static uint32_t blank_check_sector(uint32_t tmp_sect1, uint32_t tmp_sect2);
......@@ -157,7 +157,7 @@ static uint32_t iap(uint32_t code, uint32_t p1, uint32_t p2, uint32_t p3, uint32
iap_command[3] = p3; /* set 3rd param */
iap_command[4] = p4; /* set 4th param */
((void (*)())0x7ffffff1)(iap_command, iap_result); /* IAP entry point */
IAP_Entry(iap_command, iap_result); /* IAP entry point */
return *iap_result;
}
......
......@@ -578,7 +578,8 @@ diskio_sta_t mci_initialize(void)
/* This loop will take a time. Insert wai_tsk(1) here for multitask envilonment. */
if (xtimer_now_usec() > (start + 1000000/* !Timer[0] */)) {
DEBUG("now: %lu, started at: %lu\n", xtimer_now_usec(), start);
DEBUG("now: %" PRIu32 ", started at: %" PRIu32 "\n",
xtimer_now_usec(), start);
DEBUG("%s, %d: Timeout #2\n", RIOT_FILE_RELATIVE, __LINE__);
goto di_fail;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment