diff Output/pjrcUSB/arm/usb_dev.c @ 370:39e338a6733d

Fixing default ErgoDox layout and adding FlashMode button - Adds proper flashMode support for all keyboards and microcontrollers (usb and serial) - flashModeEnabled must be set to 1 otherwise it will only show an error * This is on purpose (somewhat dangerous feature as it allows remote flashing) - Capability cleanup
author Jacob Alexander <haata@kiibohd.com>
date Fri, 21 Aug 2015 19:43:45 -0700
parents 06a54d582bf8
children 47f89f1bfdb7
line wrap: on
line diff
--- a/Output/pjrcUSB/arm/usb_dev.c	Fri Aug 21 18:26:46 2015 -0700
+++ b/Output/pjrcUSB/arm/usb_dev.c	Fri Aug 21 19:43:45 2015 -0700
@@ -34,6 +34,7 @@
 // Project Includes
 #include <Lib/OutputLib.h>
 #include <print.h>
+#include <kll_defs.h>
 
 // Local Includes
 #include "usb_dev.h"
@@ -872,6 +873,14 @@
 
 void usb_device_reload()
 {
+	if ( flashModeEnabled_define == 0 )
+	{
+		print( NL );
+		warn_print("flashModeEnabled not set, cancelling firmware reload...");
+		info_msg("Set flashModeEnabled to 1 in your kll configuration.");
+		return;
+	}
+
 // MCHCK
 #if defined(_mk20dx128vlf5_)
 
@@ -882,7 +891,7 @@
 	PORTA_PCR3 = PORT_PCR_PFE | PORT_PCR_MUX(1); // Internal pull-up
 
 	// Check for jumper
-	if ( GPIOA_PDIR & (1<<3) )
+	if ( GPIOA_PDIR & (1<<3) && flashModeEnabled_define != 0 )
 	{
 		print( NL );
 		warn_print("Security jumper not present, cancelling firmware reload...");