mbed w/ spi bug fig
Fork of mbed-src by
Revision 224:e7c230c6cb31, committed 2014-06-11
- Comitter:
- mbed_official
- Date:
- Wed Jun 11 08:45:06 2014 +0100
- Parent:
- 223:fe6f83d1c519
- Child:
- 225:2af4c5d0160c
- Commit message:
- Synchronized with git revision aba739c87ab2f5818b5d93891d83ff87538d55e5
Full URL: https://github.com/mbedmicro/mbed/commit/aba739c87ab2f5818b5d93891d83ff87538d55e5/
[NRF51822] Re-init NRF Timer if powered down
Changed in this revision
targets/hal/TARGET_NORDIC/TARGET_NRF51822/us_ticker.c | Show annotated file Show diff for this revision Revisions of this file |
--- a/targets/hal/TARGET_NORDIC/TARGET_NRF51822/us_ticker.c Tue Jun 10 10:45:07 2014 +0100 +++ b/targets/hal/TARGET_NORDIC/TARGET_NRF51822/us_ticker.c Wed Jun 11 08:45:06 2014 +0100 @@ -62,7 +62,7 @@ } #endif void us_ticker_init(void){ - if (us_ticker_inited){ + if (us_ticker_inited && US_TICKER_TIMER->POWER){ return; } @@ -75,18 +75,18 @@ US_TICKER_TIMER->PRESCALER = 4; US_TICKER_TIMER->BITMODE = TIMER_BITMODE_BITMODE_16Bit; - US_TICKER_TIMER->TASKS_CLEAR =1; - US_TICKER_TIMER->CC[1] = 0xFFFF; - US_TICKER_TIMER->INTENSET = TIMER_INTENSET_COMPARE1_Set << TIMER_INTENSET_COMPARE1_Pos; + US_TICKER_TIMER->TASKS_CLEAR =1; + US_TICKER_TIMER->CC[1] = 0xFFFF; + US_TICKER_TIMER->INTENSET = TIMER_INTENSET_COMPARE1_Set << TIMER_INTENSET_COMPARE1_Pos; - NVIC_SetPriority(US_TICKER_TIMER_IRQn, 3); + NVIC_SetPriority(US_TICKER_TIMER_IRQn, 3); NVIC_EnableIRQ(US_TICKER_TIMER_IRQn); US_TICKER_TIMER->TASKS_START = 0x01; } uint32_t us_ticker_read(){ - if (!us_ticker_inited){ + if (!us_ticker_inited || US_TICKER_TIMER->POWER==0){ us_ticker_init(); } @@ -101,7 +101,7 @@ } void us_ticker_set_interrupt(unsigned int timestamp){ - if (!us_ticker_inited) + if (!us_ticker_inited || US_TICKER_TIMER->POWER==0) { us_ticker_init(); }