X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=quantum%2Fapi.c;h=233f99636de4a9dd16cee230602f463003c688c8;hb=d686c0ea43d6a9db7768da64ee54c3ba25c018f7;hp=4ca3b96762dd3a44cf8bb31d79e25910abb5e5bc;hpb=8f0a8cb7a6c001dd07bdf0c701e40a80b16f5c15;p=qmk_firmware.git diff --git a/quantum/api.c b/quantum/api.c index 4ca3b9676..233f99636 100644 --- a/quantum/api.c +++ b/quantum/api.c @@ -1,3 +1,19 @@ +/* Copyright 2016 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #include "api.h" #include "quantum.h" @@ -51,7 +67,7 @@ void process_api(uint16_t length, uint8_t * data) { case DT_RGBLIGHT: { #ifdef RGBLIGHT_ENABLE uint32_t rgblight = bytes_to_dword(data, 2); - rgblight_update_dword(rgblight); + eeconfig_update_rgblight(rgblight); #endif break; } @@ -116,28 +132,29 @@ void process_api(uint16_t length, uint8_t * data) { MT_GET_DATA_ACK(DT_KEYMAP_SIZE, keymap_size, 2); break; } - case DT_KEYMAP: { - uint8_t keymap_data[MATRIX_ROWS * MATRIX_COLS * 4 + 3]; - keymap_data[0] = data[2]; - keymap_data[1] = MATRIX_ROWS; - keymap_data[2] = MATRIX_COLS; - for (int i = 0; i < MATRIX_ROWS; i++) { - for (int j = 0; j < MATRIX_COLS; j++) { - keymap_data[3 + (i*MATRIX_COLS*2) + (j*2)] = pgm_read_word(&keymaps[data[2]][i][j]) >> 8; - keymap_data[3 + (i*MATRIX_COLS*2) + (j*2) + 1] = pgm_read_word(&keymaps[data[2]][i][j]) & 0xFF; - } - } - MT_GET_DATA_ACK(DT_KEYMAP, keymap_data, MATRIX_ROWS * MATRIX_COLS * 4 + 3); - // uint8_t keymap_data[5]; - // keymap_data[0] = data[2]; - // keymap_data[1] = data[3]; - // keymap_data[2] = data[4]; - // keymap_data[3] = pgm_read_word(&keymaps[data[2]][data[3]][data[4]]) >> 8; - // keymap_data[4] = pgm_read_word(&keymaps[data[2]][data[3]][data[4]]) & 0xFF; + // This may be too much + // case DT_KEYMAP: { + // uint8_t keymap_data[MATRIX_ROWS * MATRIX_COLS * 4 + 3]; + // keymap_data[0] = data[2]; + // keymap_data[1] = MATRIX_ROWS; + // keymap_data[2] = MATRIX_COLS; + // for (int i = 0; i < MATRIX_ROWS; i++) { + // for (int j = 0; j < MATRIX_COLS; j++) { + // keymap_data[3 + (i*MATRIX_COLS*2) + (j*2)] = pgm_read_word(&keymaps[data[2]][i][j]) >> 8; + // keymap_data[3 + (i*MATRIX_COLS*2) + (j*2) + 1] = pgm_read_word(&keymaps[data[2]][i][j]) & 0xFF; + // } + // } + // MT_GET_DATA_ACK(DT_KEYMAP, keymap_data, MATRIX_ROWS * MATRIX_COLS * 4 + 3); + // // uint8_t keymap_data[5]; + // // keymap_data[0] = data[2]; + // // keymap_data[1] = data[3]; + // // keymap_data[2] = data[4]; + // // keymap_data[3] = pgm_read_word(&keymaps[data[2]][data[3]][data[4]]) >> 8; + // // keymap_data[4] = pgm_read_word(&keymaps[data[2]][data[3]][data[4]]) & 0xFF; - // MT_GET_DATA_ACK(DT_KEYMAP, keymap_data, 5); - break; - } + // // MT_GET_DATA_ACK(DT_KEYMAP, keymap_data, 5); + // break; + // } default: break; } @@ -175,4 +192,4 @@ void process_api(uint16_t length, uint8_t * data) { // #endif } -} \ No newline at end of file +}