diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/export/thread.h | 1 | ||||
-rw-r--r-- | firmware/thread.c | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/firmware/export/thread.h b/firmware/export/thread.h index 2ff4694159..3a979722b9 100644 --- a/firmware/export/thread.h +++ b/firmware/export/thread.h | |||
@@ -150,6 +150,7 @@ void wakeup_thread(struct thread_entry **thread); | |||
150 | int thread_set_priority(struct thread_entry *thread, int priority); | 150 | int thread_set_priority(struct thread_entry *thread, int priority); |
151 | int thread_get_priority(struct thread_entry *thread); | 151 | int thread_get_priority(struct thread_entry *thread); |
152 | #endif | 152 | #endif |
153 | struct thread_entry * thread_get_current(void); | ||
153 | void init_threads(void); | 154 | void init_threads(void); |
154 | int thread_stack_usage(const struct thread_entry *thread); | 155 | int thread_stack_usage(const struct thread_entry *thread); |
155 | int thread_get_status(const struct thread_entry *thread); | 156 | int thread_get_status(const struct thread_entry *thread); |
diff --git a/firmware/thread.c b/firmware/thread.c index 281ab0fa54..614286c422 100644 --- a/firmware/thread.c +++ b/firmware/thread.c | |||
@@ -776,6 +776,11 @@ int thread_get_priority(struct thread_entry *thread) | |||
776 | } | 776 | } |
777 | #endif | 777 | #endif |
778 | 778 | ||
779 | struct thread_entry * thread_get_current(void) | ||
780 | { | ||
781 | return cores[CURRENT_CORE].running; | ||
782 | } | ||
783 | |||
779 | void init_threads(void) | 784 | void init_threads(void) |
780 | { | 785 | { |
781 | unsigned int core = CURRENT_CORE; | 786 | unsigned int core = CURRENT_CORE; |