You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					47 lines
				
				1.0 KiB
			
		
		
			
		
	
	
					47 lines
				
				1.0 KiB
			|   
											10 years ago
										 | #include "retro_refit.h"
 | ||
|   
											9 years ago
										 | #include "led.h"
 | ||
|   
											10 years ago
										 | 
 | ||
|   
											10 years ago
										 | void matrix_init_kb(void) { | ||
|   
											10 years ago
										 |     // put your keyboard start-up code here
 | ||
|  |     // runs once when the firmware starts up
 | ||
|  | 
 | ||
|  |     // Disable status LED on KB, enable status LED on Teensy (KB_STATUS = !TEENSY_STATUS)
 | ||
|  |     DDRD |= (1<<6); | ||
|  |     PORTD |= (1<<6); | ||
|  | 
 | ||
|  |     matrix_init_user(); | ||
|   
											10 years ago
										 | }; | ||
|  | 
 | ||
|   
											10 years ago
										 | void led_set_kb(uint8_t usb_led) { | ||
|   
											10 years ago
										 |     // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
 | ||
|   
											10 years ago
										 | 
 | ||
|  |     if (usb_led & (1<<USB_LED_CAPS_LOCK)) { | ||
|  |         // output low
 | ||
|  |         DDRD |= (1<<0); | ||
|  |         PORTD &= ~(1<<0); | ||
|  |     } else { | ||
|  |         // Hi-Z
 | ||
|  |         DDRD &= ~(1<<0); | ||
|  |         PORTD &= ~(1<<0); | ||
|  |     } | ||
|  |     if (usb_led & (1<<USB_LED_NUM_LOCK)) { | ||
|  |         // output low
 | ||
|  |         DDRD |= (1<<1); | ||
|  |         PORTD &= ~(1<<1); | ||
|  |     } else { | ||
|  |         // Hi-Z
 | ||
|  |         DDRD &= ~(1<<1); | ||
|  |         PORTD &= ~(1<<1); | ||
|  |     } | ||
|  |     if (usb_led & (1<<USB_LED_SCROLL_LOCK)) { | ||
|  |         // output low
 | ||
|  |         DDRC |= (1<<6); | ||
|  |         PORTC &= ~(1<<6); | ||
|  |     } else { | ||
|  |         // Hi-Z
 | ||
|  |         DDRC &= ~(1<<6); | ||
|  |         PORTC &= ~(1<<6); | ||
|   
											10 years ago
										 |     } | ||
|  | 
 | ||
|  |     led_set_user(usb_led); | ||
|   
											10 years ago
										 | }; |