We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d5f0985 commit 2259834Copy full SHA for 2259834
hal/targets/hal/TARGET_NXP/TARGET_LPC15XX/us_ticker.c
@@ -16,6 +16,7 @@
16
#include <stddef.h>
17
#include "us_ticker_api.h"
18
#include "PeripheralNames.h"
19
+#include "critical.h"
20
21
#define US_TICKER_TIMER_IRQn SCT3_IRQn
22
@@ -61,11 +62,11 @@ uint32_t us_ticker_read() {
61
62
63
void us_ticker_set_interrupt(timestamp_t timestamp) {
64
// Set SCT3 match register 0 (critical section)
- __disable_irq();
65
+ core_util_critical_section_enter();
66
LPC_SCT3->CTRL |= (1 << 2);
67
LPC_SCT3->MATCH0 = (uint32_t)timestamp;
68
LPC_SCT3->CTRL &= ~(1 << 2);
- __enable_irq();
69
+ core_util_critical_section_exit();
70
71
// Enable interrupt on SCT3 event 0
72
LPC_SCT3->EVEN = (1 << 0);
0 commit comments