Add bootmagic salt key to avoid accidental configuration
This commit is contained in:
		
							parent
							
								
									7e5081b5a8
								
							
						
					
					
						commit
						05225dd9d8
					
				
					 4 changed files with 20 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -5,6 +5,7 @@
 | 
			
		|||
#include "bootloader.h"
 | 
			
		||||
#include "debug.h"
 | 
			
		||||
#include "keymap.h"
 | 
			
		||||
#include "action_layer.h"
 | 
			
		||||
#include "eeconfig.h"
 | 
			
		||||
#include "bootmagic.h"
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -94,7 +95,7 @@ void bootmagic(void)
 | 
			
		|||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool bootmagic_scan_keycode(uint8_t keycode)
 | 
			
		||||
static bool scan_keycode(uint8_t keycode)
 | 
			
		||||
{
 | 
			
		||||
    for (uint8_t r = 0; r < MATRIX_ROWS; r++) {
 | 
			
		||||
        matrix_row_t matrix_row = matrix_get_row(r);
 | 
			
		||||
| 
						 | 
				
			
			@ -108,3 +109,10 @@ bool bootmagic_scan_keycode(uint8_t keycode)
 | 
			
		|||
    }
 | 
			
		||||
    return false;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool bootmagic_scan_keycode(uint8_t keycode)
 | 
			
		||||
{
 | 
			
		||||
    if (!scan_keycode(BOOTMAGIC_KEY_SALT)) return false;
 | 
			
		||||
 | 
			
		||||
    return scan_keycode(keycode);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,6 +2,12 @@
 | 
			
		|||
#define BOOTMAGIC_H
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* bootmagic salt key */
 | 
			
		||||
#ifndef BOOTMAGIC_KEY_SALT
 | 
			
		||||
#define BOOTMAGIC_KEY_SALT              KC_SPACE
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* skip bootmagic and eeconfig */
 | 
			
		||||
#ifndef BOOTMAGIC_KEY_SKIP
 | 
			
		||||
#define BOOTMAGIC_KEY_SKIP              KC_ESC
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue