Project

General

Profile

Revision 345

reorganizing

View differences:

makecode_map.c
1 1
#include "makecode_map.h"
2 2

  
3
static const char makecode_map[] = {'1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '\'', ERROR_CODE /*«*/, ERROR_CODE /*escape*/,
3
static const char makecode_map[] = {ERROR_CODE, ERROR_CODE, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '\'', ERROR_CODE /*«*/, ERROR_CODE /*escape*/,
4 4
                                    ERROR_CODE /*tab*/, 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '+', ERROR_CODE /* ´ */, ERROR_CODE /*enter*/,
5 5
                                    ERROR_CODE /*ctrl*/, 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ERROR_CODE /* Ç */, ERROR_CODE /* º */, '\\', ERROR_CODE /*lshift*/, '~',
6 6
                                    'Z', 'X', 'C', 'V', 'B', 'N', 'M', ',', '.', '-', ERROR_CODE /*rshift*/, ERROR_CODE /*unkown*/, ERROR_CODE /*alt*/, ' ' /*space*/};
......
8 8
static const int size = sizeof(makecode_map);
9 9

  
10 10
char (map_makecode)(uint8_t code) {
11
    int key = code - BASE_CODE;
12
    if (key < 0 || key >= size) return ERROR_CODE;
13
    return makecode_map[key];
11
    if (code < 0 || code >= size) return ERROR_CODE;
12
    return makecode_map[code];
14 13
}

Also available in: Unified diff