File tree 1 file changed +11
-8
lines changed 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -52,24 +52,27 @@ STATIC machine_rtc_obj_t machine_rtc_obj[] = {
52
52
};
53
53
54
54
STATIC void hal_interrupt_handle (NRF_RTC_Type * p_instance ) {
55
+ const machine_rtc_obj_t * self = NULL ;
55
56
if (p_instance == RTC0 ) {
56
- const machine_rtc_obj_t * self = & machine_rtc_obj [0 ];
57
+ self = & machine_rtc_obj [0 ];
57
58
mp_call_function_0 (self -> callback );
58
-
59
- hal_rtc_stop (& self -> rtc -> config );
60
- if (self -> mode == 1 ) {
61
- hal_rtc_start (& self -> rtc -> config , self -> period );
62
- }
63
59
} else if (p_instance == RTC1 ) {
64
- const machine_rtc_obj_t * self = & machine_rtc_obj [1 ];
60
+ self = & machine_rtc_obj [1 ];
65
61
mp_call_function_0 (self -> callback );
66
62
}
67
63
#if NRF52
68
64
else if (p_instance == RTC2 ) {
<
8000
td data-grid-cell-id="diff-ad0b1e5c2d341b3f9a575f092c442b364d48a7b62ce16e1bd990b939b5a46d80-69-64-0" data-selected="false" role="gridcell" style="background-color:var(--diffBlob-deletionNum-bgColor, var(--diffBlob-deletion-bgColor-num));text-align:center" tabindex="-1" valign="top" class="focusable-grid-cell diff-line-number position-relative left-side">69
- const machine_rtc_obj_t * self = & machine_rtc_obj [2 ];
65
+ self = & machine_rtc_obj [2 ];
70
66
mp_call_function_0 (self -> callback );
71
67
}
72
68
#endif
69
+
70
+ if (self != NULL ) {
71
+ hal_rtc_stop (& self -> rtc -> config );
72
+ if (self -> mode == 1 ) {
73
+ hal_rtc_start (& self -> rtc -> config , self -> period );
74
+ }
75
+ }
73
76
}
74
77
75
78
void rtc_init0 (void ) {
You can’t perform that action at this time.
0 commit comments