Skip to content

Commit

Permalink
Merge pull request #8122 from thesupershan/master
Browse files Browse the repository at this point in the history
LPC1768 us_ticker.c timer choice
  • Loading branch information
Cruz Monrreal authored Oct 10, 2018
2 parents 21b4eca + e5000ab commit 9f98d39
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
11 changes: 11 additions & 0 deletions targets/TARGET_NXP/TARGET_LPC176X/us_ticker.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 6 additions & 0 deletions targets/targets.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down

0 comments on commit 9f98d39

Please sign in to comment.