display.c
void disp_convert(unsigned char *image, const unsigned char *bytemap)
{
  for (int page = 0; page < NUM_PAGES; page++)
    for (int col = 0; col < NUM_COLS; col++) {
      unsigned char seg = 0x00;
      for (int row = 0; row < NUM_ROWS; row++) {
	int y = page * NUM_ROWS + row;
	seg |= (!!bytemap[y * NUM_COLS + col]) << row;
      }
      image[page * NUM_COLS + col] = seg;
    }
}
/* Convert row-major, one byte per pixel, to display image. */
Convert row-major, one byte per pixel, to display image.
Convert row - major one byte per pixel to display image .
void disp_convert(unsigned char *image, const unsigned char *bytemap)
{
  for (int page = 0; page < NUM_PAGES; page++)
    for (int col = 0; col < NUM_COLS; col++) {
      unsigned char seg = 0x00;
      for (int row = 0; row < NUM_ROWS; row++) {
	int y = page * NUM_ROWS + row;
	seg |= (!!bytemap[y * NUM_COLS + col]) << row;
      }
      image[page * NUM_COLS + col] = seg;
    }
}
void disp_convert ( unsigned char * image , const unsigned char * bytemap ) { for ( int page = 0 ; page < NUM_PAGES ; page ++ ) for ( int col = 0 ; col < NUM_COLS ; col ++ ) { unsigned char seg = 0x00 ; for ( int row = 0 ; row < NUM_ROWS ; row ++ ) { int y = page * NUM_ROWS + row ; seg |= ( ! ! bytemap [ y * NUM_COLS + col ] ) << row ; } image [ page * NUM_COLS + col ] = seg ; } }
Convert row-major, one byte per pixel, to display image.
Convert row - major one byte per pixel to display image .