timeout.c
Go to the documentation of this file.
1 
6 /*
7  * The contents of this file are subject to the Mozilla Public License
8  * Version 1.0 (the "License"); you may not use this file except in
9  * compliance with the License. You may obtain a copy of the License
10  * at http://www.mozilla.org/MPL/
11  *
12  * Software distributed under the License is distributed on an "AS IS"
13  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14  * the License for the specific language governing rights and
15  * limitations under the License.
16  *
17  * The Original Code is legOS code, released October 17, 1999.
18  *
19  * The Initial Developer of the Original Code is Markus L. Noga.
20  * Portions created by Markus L. Noga are Copyright (C) 1999
21  * Markus L. Noga. All Rights Reserved.
22  *
23  * Contributor(s): Markus L. Noga <markus@noga.de>
24  * Rossz Vámos-Wentworth <rossw@jps.net>
25  */
26 
27 #include <sys/irq.h>
28 #include <sys/tm.h>
29 #include <sys/timeout.h>
30 
31 #ifdef CONF_AUTOSHUTOFF
32 volatile unsigned int auto_shutoff_counter = 0; //<! current count - used by the system timer
33 unsigned int auto_shutoff_period = 500; //<! milliseconds between shutoff checks
34 unsigned int auto_shutoff_secs = DEFAULT_SHUTOFF_TIME; //<! seconds of idle to auto shutoff
35 volatile unsigned int auto_shutoff_elapsed = 0; //<! idle seconds elapsed
36 volatile unsigned int idle_powerdown = 0; //<! true if a auto-shutoff should occur
37 
38 void shutoff_restart(void) {
41 }
42 
43 void shutoff_init(void) {
44 // auto_shutoff_secs = DEFAULT_SHUTOFF_TIME;
46  idle_powerdown = 0;
47 }
48 
49 #ifdef CONF_RCX_COMPILER
50 void autoshutoff_check(void) {
51 #else
52 HANDLER_WRAPPER("autoshutoff_check","autoshutoff_check_core");
53 void autoshutoff_check_core(void) {
54 #endif
55 #ifdef CONF_TM
56  if (nb_tasks <= nb_system_tasks) {
57 #endif // CONF_TM
60  idle_powerdown = 1;
61 #ifdef CONF_TM
62  }
63  else
65 #endif // CONF_TM
66 }
67 
68 #endif
void shutoff_restart(void)
HANDLER_WRAPPER("lcd_refresh_next_byte", "lcd_refresh_next_byte_core")
lcd refresh handler, called from system timer interrupt
volatile unsigned int nb_tasks
number of tasks
Internal Interface: Powerdown Timer Routines.
volatile unsigned int nb_system_tasks
volatile unsigned int auto_shutoff_elapsed
#define DEFAULT_SHUTOFF_TIME
Definition: timeout.h:39
Internal Interface: task management.
unsigned int auto_shutoff_period
void autoshutoff_check(void)
void shutoff_init(void)
volatile unsigned int auto_shutoff_counter
unsigned int auto_shutoff_secs
Internal LNP Interface: RCX redirected IRQ vectors.
volatile unsigned int idle_powerdown

brickOS is released under the Mozilla Public License.
Original code copyright 1998-2005 by the authors.

Generated for brickOS Kernel Developer by doxygen 1.8.12