vis.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 at
10 * 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 the
14 * License for the specific language governing rights and limitations
15 * 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 */
25
26#include <sys/vis.h>
27
28#ifdef CONF_VIS
29
30#include <conio.h>
31#include <sys/irq.h>
32#include <dsensor.h>
33#include <dmotor.h>
34#include <sys/program.h>
35#include <sys/tm.h>
36
38//
39// Variables
40//
42
43unsigned char vis_refresh_counter = 0;
44unsigned char vis_refresh_period = 50;
45
47//
48// Functions
49//
51
52#ifdef CONF_RCX_COMPILER
53void vis_handler(void) {
54#else
55HANDLER_WRAPPER("vis_handler","vis_core");
56void vis_core(void) {
57#endif
58#ifdef CONF_DSENSOR
59 bit_iload(AD_C_H,0x7);
61
62 bit_iload(AD_B_H,0x7);
64
65 bit_iload(AD_A_H,0x7);
67#endif
68
69#ifdef CONF_PROGRAM
70 if(nb_tasks <= nb_system_tasks) { // show only while program not running.
73 else
74 cputc_0('-');
75 }
76#endif
77}
78
79#endif // CONF_VIS
#define bit_iload(mask, bit)
load the inverse of a single bit from a mask to the carry flag
Definition: bitops.h:77
Interface: console input / output.
void cputc_hex_0(unsigned nibble)
write HEX digit to position 0 of LCD
Definition: conio.h:128
void cputc_0(unsigned c)
write ASCII char to position 0 of LCD
Definition: conio.h:174
#define LCD_S1_ACTIVE
Definition: dlcd.h:126
#define dlcd_store(a)
store the carry flag to a segment directly in the LCD buffer
Definition: dlcd.h:187
#define LCD_S3_ACTIVE
Definition: dlcd.h:132
#define LCD_S2_ACTIVE
Definition: dlcd.h:129
volatile unsigned char AD_A_H
A/D converter data register A high.
volatile unsigned char AD_B_H
A/D converter data register B high.
volatile unsigned char AD_C_H
A/D converter data register C high.
Internal LNP Interface: RCX redirected IRQ vectors.
HANDLER_WRAPPER("lcd_refresh_next_byte", "lcd_refresh_next_byte_core")
lcd refresh handler, called from system timer interrupt
Internal Interface: program data structures and functions.
int program_valid(unsigned nr)
check if a given program is valid.
volatile unsigned cprog
the current program
Internal Interface: task management.
volatile unsigned int nb_tasks
number of tasks
volatile unsigned int nb_system_tasks
Internal Interface: visualization of BrickOS state.
void vis_handler(void)
visualize sensor/motor state and selected program.

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

Generated for brickOS Kernel Developer by doxygen 1.9.4