Hardware Reference
In-Depth Information
31 static void
32 post_SW1(void) {
33
34 mutex_lock(); /
Lock for shared curses access
/
35 attrset(A_REVERSE);
36 mvprintw(3,4,"SW1:");
37 attrset(A_NORMAL);
38 move (3,9);
39 if ( SW1 < 0 ) {
40 addstr("???");
41 } else {
42 if ( SW1 ) {
43 attrset(A_BOLD); /
Blink when switch on
/
44 addstr("On ");
45 } else {
46 attrset(A_NORMAL);
47 addstr("Off"); /
SW1 is off
/
48 }
49 }
50 attrset(A_NORMAL);
51 if ( SW1 >= 0 || LED >= 0 )
52 mvprintw(7,15,"ONLINE ");
53 move(7,12);
54 refresh();
55 mutex_unlock(); /
Done with curses
/
56 }
57
58 /
59
Post LED status to console screen
60
/
61 static void
62 post_LED(void) {
63
64 mutex_lock(); /
Lock shared curses access
/
65 attrset(A_REVERSE);
66 mvprintw(5,4,"LED:");
67 attrset(A_NORMAL);
68 move(5,9);
69
70 if ( LED < 0 ) {
71 addstr("???");
72 } else {
73 if ( LED ) {
74 attrset(A_BOLD);
75 addstr("On ") /
LED is now on
/
76 } else {
Search WWH ::




Custom Search