forked from mirrors/qmk_userspace
		
	Disable JTAG in keyboard init
So that all boards, present and future will have JTAG disabled, even if using a custom matrix
This commit is contained in:
		
					parent
					
						
							
								c5db272c91
							
						
					
				
			
			
				commit
				
					
						ee3b9d2ef0
					
				
			
		
					 2 changed files with 6 additions and 7 deletions
				
			
		| 
						 | 
				
			
			@ -148,12 +148,6 @@ uint8_t matrix_cols(void) {
 | 
			
		|||
 | 
			
		||||
void matrix_init(void) {
 | 
			
		||||
 | 
			
		||||
    // To use PORTF disable JTAG with writing JTD bit twice within four cycles.
 | 
			
		||||
    #if  (defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) || defined(__AVR_ATmega32U4__))
 | 
			
		||||
        MCUCR |= _BV(JTD);
 | 
			
		||||
        MCUCR |= _BV(JTD);
 | 
			
		||||
    #endif
 | 
			
		||||
 | 
			
		||||
    // initialize row and col
 | 
			
		||||
#if (DIODE_DIRECTION == COL2ROW)
 | 
			
		||||
    unselect_rows();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -148,6 +148,11 @@ bool is_keyboard_master(void) {
 | 
			
		|||
 */
 | 
			
		||||
void keyboard_init(void) {
 | 
			
		||||
    timer_init();
 | 
			
		||||
// To use PORTF disable JTAG with writing JTD bit twice within four cycles.
 | 
			
		||||
#if  (defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) || defined(__AVR_ATmega32U4__))
 | 
			
		||||
  MCUCR |= _BV(JTD);
 | 
			
		||||
  MCUCR |= _BV(JTD);
 | 
			
		||||
#endif
 | 
			
		||||
    matrix_init();
 | 
			
		||||
#ifdef PS2_MOUSE_ENABLE
 | 
			
		||||
    ps2_mouse_init();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue