Merge pull request #1 from thesupershan/lpc1768-us-ticker

choose which lpc1768 timer to use for us_ticker.c
pull/8122/head
thesupershan 2018-09-13 08:35:47 -07:00 committed by Aleshandre Diaz
commit e5000abd93
2 changed files with 17 additions and 0 deletions

View File

@ -28,8 +28,19 @@ const ticker_info_t* us_ticker_get_info()
static bool us_ticker_inited = false;
#if MBED_CONF_TARGET_US_TICKER_TIMER == 0
#define US_TICKER_TIMER ((LPC_TIM_TypeDef *)LPC_TIM0_BASE)
#define US_TICKER_TIMER_IRQn TIMER0_IRQn
#elif MBED_CONF_TARGET_US_TICKER_TIMER == 1
#define US_TICKER_TIMER ((LPC_TIM_TypeDef *)LPC_TIM1_BASE)
#define US_TICKER_TIMER_IRQn TIMER1_IRQn
#elif MBED_CONF_TARGET_US_TICKER_TIMER == 2
#define US_TICKER_TIMER ((LPC_TIM_TypeDef *)LPC_TIM2_BASE)
#define US_TICKER_TIMER_IRQn TIMER2_IRQn
#else
#define US_TICKER_TIMER ((LPC_TIM_TypeDef *)LPC_TIM3_BASE)
#define US_TICKER_TIMER_IRQn TIMER3_IRQn
#endif
void us_ticker_init(void) {
if (us_ticker_inited) {

View File

@ -247,6 +247,12 @@
"release_versions": ["2", "5"],
"device_name": "LPC1768",
"bootloader_supported": true,
"config": {
"us-ticker-timer": {
"help": "Chooses which timer (0-3) to use for us_ticker.c",
"value": 3
}
},
"overrides": {
"network-default-interface-type": "ETHERNET"
}