DD2-monitor/viz/curses/7segments.c
2019-01-22 14:25:26 +01:00

57 lines
827 B
C

/*
* 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;
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;
}
/* ---------------------------------------------------------------- */
/* ---------------------------------------------------------------- */