summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/export/thread.h1
-rw-r--r--firmware/thread.c8
2 files changed, 1 insertions, 8 deletions
diff --git a/firmware/export/thread.h b/firmware/export/thread.h
index f5a4b50ddd..c6b3c8e4e3 100644
--- a/firmware/export/thread.h
+++ b/firmware/export/thread.h
@@ -30,6 +30,5 @@ void sleep_thread(void);
30void wake_up_thread(void); 30void wake_up_thread(void);
31void init_threads(void); 31void init_threads(void);
32int thread_stack_usage(int threadnum); 32int thread_stack_usage(int threadnum);
33void cpu_sleep(bool enabled);
34 33
35#endif 34#endif
diff --git a/firmware/thread.c b/firmware/thread.c
index ea518ca4ee..aedd665d2e 100644
--- a/firmware/thread.c
+++ b/firmware/thread.c
@@ -33,7 +33,6 @@ struct regs
33}; 33};
34 34
35int num_threads; 35int num_threads;
36bool cpu_sleep_enabled;
37static volatile int num_sleepers; 36static volatile int num_sleepers;
38static int current_thread; 37static int current_thread;
39static struct regs thread_contexts[MAXTHREADS] __attribute__ ((section(".idata"))); 38static struct regs thread_contexts[MAXTHREADS] __attribute__ ((section(".idata")));
@@ -104,7 +103,7 @@ void switch_thread(void)
104 /* Do nothing */ 103 /* Do nothing */
105#else 104#else
106 105
107 while (cpu_sleep_enabled && num_sleepers == num_threads) 106 while (num_sleepers == num_threads)
108 { 107 {
109 /* Enter sleep mode, woken up on interrupt */ 108 /* Enter sleep mode, woken up on interrupt */
110 SBYCR &= 0x7F; 109 SBYCR &= 0x7F;
@@ -125,11 +124,6 @@ void switch_thread(void)
125 panicf("Stkov %s", thread_name[next]); 124 panicf("Stkov %s", thread_name[next]);
126} 125}
127 126
128void cpu_sleep(bool enabled)
129{
130 cpu_sleep_enabled = enabled;
131}
132
133void sleep_thread(void) 127void sleep_thread(void)
134{ 128{
135 ++num_sleepers; 129 ++num_sleepers;