Merge pull request #8122 from thesupershan/master

LPC1768 us_ticker.c timer choice
pull/8374/head
Cruz Monrreal 2018-10-10 11:07:26 -05:00 committed by GitHub
commit 9f98d39d1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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

@ -251,6 +251,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"
}