Skip to content

Remove dependency on us_ticker HAL apis for non USTICKER targets #10155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions hal/mbed_us_ticker_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include <stddef.h>
#include "hal/us_ticker_api.h"

#if DEVICE_USTICKER

static ticker_event_queue_t events = { 0 };

static ticker_irq_handler_type irq_handler = ticker_irq_handler;
Expand Down Expand Up @@ -56,3 +60,12 @@ void us_ticker_irq_handler(void)
irq_handler(&us_data);
}
}

#else

const ticker_data_t *get_us_ticker_data(void)
{
return NULL;
}

#endif // DEVICE_USTICKER
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#include "fsl_ctimer.h"
#include "PeripheralNames.h"

#if DEVICE_USTICKER

#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
#define CTIMER CTIMER0
#define CTIMER_IRQn CTIMER0_IRQn
Expand Down Expand Up @@ -117,3 +119,6 @@ void us_ticker_free(void)
NVIC_DisableIRQ(CTIMER_IRQn);
us_ticker_inited = false;
}

#endif // DEVICE_USTICKER

21 changes: 14 additions & 7 deletions targets/targets.json
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,8 @@
"STDIO_MESSAGES",
"FLASH",
"MPU",
"USBDEVICE"
"USBDEVICE",
"USTICKER"
],
"release_versions": ["2", "5"],
"device_name": "LPC1768",
Expand Down Expand Up @@ -872,7 +873,8 @@
"SPI",
"SPISLAVE",
"STDIO_MESSAGES",
"MPU"
"MPU",
"USTICKER"
],
"device_name": "LPC4088FBD144",
"overrides": {
Expand Down Expand Up @@ -5413,7 +5415,8 @@
"SERIAL_FC",
"SLEEP",
"SPI",
"STDIO_MESSAGES"
"STDIO_MESSAGES",
"USTICKER"
],
"release_versions": ["2", "5"]
},
Expand Down Expand Up @@ -6485,7 +6488,8 @@
"SERIAL",
"SPI",
"SPISLAVE",
"STDIO_MESSAGES"
"STDIO_MESSAGES",
"USTICKER"
],
"release_versions": ["2", "5"]
},
Expand All @@ -6510,7 +6514,8 @@
"SERIAL",
"SPI",
"SPISLAVE",
"STDIO_MESSAGES"
"STDIO_MESSAGES",
"USTICKER"
],
"release_versions": ["2", "5"]
},
Expand All @@ -6534,7 +6539,8 @@
"SERIAL",
"SPI",
"SPISLAVE",
"STDIO_MESSAGES"
"STDIO_MESSAGES",
"USTICKER"
],
"release_versions": ["2", "5"]
},
Expand Down Expand Up @@ -7243,7 +7249,8 @@
"TRNG",
"SPISLAVE",
"802_15_4_PHY",
"MPU"
"MPU",
"USTICKER"
],
"release_versions": ["2", "5"]
},
Expand Down