Skip to content

Commit 14050b7

Browse files
committed
drivers: clock_control: Separated nrf hfclk shim from nrf clock shim.
Separated clock_control_nrf_hfclk shim from clock_control_nrf shim. Signed-off-by: Michal Frankiewicz <[email protected]>
1 parent e85c5b6 commit 14050b7

16 files changed

+493
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#include "clock_control_nrf_common.h"
2+
3+
#if NRFX_CHECK(NRFX_POWER_ENABLED)
4+
#include <nrfx_power.h>
5+
#endif
6+
7+
static bool irq_connected = false;
8+
9+
static void clock_irq_handler(void)
10+
{
11+
#if NRFX_CHECK(NRFX_POWER_ENABLED)
12+
nrfx_power_irq_handler();
13+
#endif
14+
15+
STRUCT_SECTION_FOREACH(clock_control_nrf_irq_handler, irq) {
16+
irq->handler();
17+
}
18+
}
19+
20+
void clock_control_nrf_common_connect_irq( void )
21+
{
22+
if (irq_connected) {
23+
return;
24+
}
25+
irq_connected = true;
26+
27+
IRQ_CONNECT(DT_INST_IRQN(0), DT_INST_IRQ(0, priority),
28+
nrfx_isr, clock_irq_handler, 0);
29+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*$$$LICENCE_NORDIC_STANDARD<2016>$$$*/
2+
3+
#ifndef CLOCK_CONTROL_NRF_COMMON_H__
4+
#define CLOCK_CONTROL_NRF_COMMON_H__
5+
6+
struct clock_control_nrf_irq_handler {
7+
void (*handler)(void); /* Clock interrupt handler */
8+
};
9+
10+
#define CLOCK_CONTROL_NRF_IRQ_HANDLERS_ITERABLE(name, _a) \
11+
STRUCT_SECTION_ITERABLE(clock_control_nrf_irq_handler, name) = { \
12+
.handler = _a, \
13+
}
14+
15+
void clock_control_nrf_common_connect_irq( void );
16+
17+
#endif // CLOCK_CONTROL_NRF_COMMON_H__

0 commit comments

Comments
 (0)