ristretto.c (1413B)
1 /* Copyright 2021 Brandon Lewis 2 * 3 * This program is free software: you can redistribute it and/or modify 4 * it under the terms of the GNU General Public License as published by 5 * the Free Software Foundation, either version 2 of the License, or 6 * (at your option) any later version. 7 * 8 * This program is distributed in the hope that it will be useful, 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * GNU General Public License for more details. 12 * 13 * You should have received a copy of the GNU General Public License 14 * along with this program. If not, see <http://www.gnu.org/licenses/>. 15 */ 16 17 #include "quantum.h" 18 19 enum layers { 20 _BASE, 21 _RAISE, 22 _LOWER, 23 _ADJUST 24 }; 25 26 #ifdef OLED_ENABLE 27 oled_rotation_t oled_init_kb(oled_rotation_t rotation) { 28 return OLED_ROTATION_270; 29 } 30 31 bool oled_task_kb(void) { 32 if (!oled_task_user()) { 33 return false; 34 } 35 oled_write_P(PSTR("\n\n"), false); 36 oled_write_ln_P(PSTR("LAYER"), false); 37 oled_write_ln_P(PSTR(""), false); 38 switch (get_highest_layer(layer_state)) { 39 case _BASE: 40 oled_write_P(PSTR("BASE\n"), false); 41 break; 42 case _RAISE: 43 oled_write_P(PSTR("RAISE\n"), false); 44 break; 45 case _LOWER: 46 oled_write_P(PSTR("LOWER\n"), false); 47 break; 48 case _ADJUST: 49 oled_write_P(PSTR("ADJ\n"), false); 50 break; 51 } 52 return false; 53 } 54 55 #endif