test avoid bulled game

Dependencies:   C12832_lcd LCD_fonts mbed mbed-rtos

Committer:
th_mbed
Date:
Mon Dec 12 12:00:44 2016 +0000
Revision:
35:b767ad058a8b
Parent:
27:afdaee781efa
Child:
36:b88fa8ff0be9
a;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
th_mbed 23:33d7efd62537 1 #include "convert.h"
th_mbed 23:33d7efd62537 2 #include "models.h"
th_mbed 23:33d7efd62537 3 #include "point.h"
pypy_o8o 25:a08a1f5fbb6a 4 #include "C12832_lcd.h"
th_mbed 23:33d7efd62537 5 #define CHAR_SIZE 8
th_mbed 23:33d7efd62537 6
pypy_o8o 25:a08a1f5fbb6a 7 Bitmap Converter::convert(int map[][LCD_X]){
th_mbed 27:afdaee781efa 8 int len = LCD_Y*LCD_X/CHAR_SIZE;
th_mbed 27:afdaee781efa 9 char char_map[len];
th_mbed 27:afdaee781efa 10 for(int i = 0; i < len; i++ ){
th_mbed 27:afdaee781efa 11 char_map[i] = 0;
th_mbed 27:afdaee781efa 12 }
th_mbed 23:33d7efd62537 13 for(int i = 0; i < LCD_Y; i++){
th_mbed 23:33d7efd62537 14 for(int j = 0; j < LCD_X; j++){
th_mbed 27:afdaee781efa 15 char_map[(i*LCD_X+j)/CHAR_SIZE] |= map[i][j] << ((CHAR_SIZE - 1) - i % CHAR_SIZE);
th_mbed 23:33d7efd62537 16 }
th_mbed 23:33d7efd62537 17 }
th_mbed 35:b767ad058a8b 18 return char_map;
th_mbed 35:b767ad058a8b 19 /*
pypy_o8o 25:a08a1f5fbb6a 20 Bitmap bitmap_converted = {
th_mbed 27:afdaee781efa 21 LCD_X,
th_mbed 27:afdaee781efa 22 LCD_Y,
th_mbed 27:afdaee781efa 23 LCD_X/CHAR_SIZE,
th_mbed 27:afdaee781efa 24 char_map,
th_mbed 27:afdaee781efa 25 };
pypy_o8o 25:a08a1f5fbb6a 26 return bitmap_converted;
th_mbed 35:b767ad058a8b 27 */
pypy_o8o 25:a08a1f5fbb6a 28 }