DD2-monitor/viz/curses/7segments.c

56 lines
756 B
C
Raw Normal View History

2019-01-10 11:44:47 +11:00
/*
* DD2 Monitoring
*
* ncurses seven segment display
*/
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <getopt.h>
#include <ncurses.h>
#include "ecran.h"
int verbosity;
/* ---------------------------------------------------------------- */
int afficheur_7segs(WINDOW * win, int lig, int col, int bits, int k)
{
int numbit, mask;
2019-01-10 11:44:47 +11:00
for (numbit=0; numbit<8; numbit++) {
mask = 1 << numbit;
switch(mask) {
case 0x01:
case 0x02:
case 0x04:
case 0x08:
case 0x10:
case 0x20:
case 0x40:
case 0x80:
/* decimal point */
break;
default:
fprintf(stderr, "%s mask is wrong\n", __func__);
break;
}
}
return -1;
}
2019-01-10 11:44:47 +11:00
/* ---------------------------------------------------------------- */