Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbed-src by
Diff: targets/hal/TARGET_NXP/TARGET_LPC43XX/us_ticker.c
- Revision:
- 300:55638feb26a4
- Parent:
- 294:78f9587bb26d
- Child:
- 304:89b9c3a9a045
--- a/targets/hal/TARGET_NXP/TARGET_LPC43XX/us_ticker.c Wed Aug 27 04:00:07 2014 +0100
+++ b/targets/hal/TARGET_NXP/TARGET_LPC43XX/us_ticker.c Wed Aug 27 08:45:06 2014 +0100
@@ -27,16 +27,16 @@
void us_ticker_init(void) {
if (us_ticker_inited) return;
us_ticker_inited = 1;
-
+
US_TICKER_TIMER->CTCR = 0x0; // timer mode
uint32_t PCLK = SystemCoreClock;
US_TICKER_TIMER->TCR = 0x2; // reset
-
+
uint32_t prescale = PCLK / 1000000; // default to 1MHz (1 us ticks)
US_TICKER_TIMER->PR = prescale - 1;
US_TICKER_TIMER->TCR = 1; // enable = 1, reset = 0
-
+
NVIC_SetVector(US_TICKER_TIMER_IRQn, (uint32_t)us_ticker_irq_handler);
NVIC_EnableIRQ(US_TICKER_TIMER_IRQn);
}
@@ -44,7 +44,7 @@
uint32_t us_ticker_read() {
if (!us_ticker_inited)
us_ticker_init();
-
+
return US_TICKER_TIMER->TC;
}
