X-Git-Url: https://git.donarmstrong.com/?p=kiibohd-controller.git;a=blobdiff_plain;f=Output%2FpjrcUSB%2Farm%2Fusb_dev.c;h=782f3ace91d024a4e1d5c8bec32cb3b57db762b1;hp=e913006e615d06970ed8e5408f0ced007a2b7af9;hb=59d425ccfe1ca3019ba80ad6dd4a228b7c7cbe33;hpb=d9ba60b34ee80e073ef708a7e9e58d8b8529a0e2 diff --git a/Output/pjrcUSB/arm/usb_dev.c b/Output/pjrcUSB/arm/usb_dev.c index e913006..782f3ac 100644 --- a/Output/pjrcUSB/arm/usb_dev.c +++ b/Output/pjrcUSB/arm/usb_dev.c @@ -911,40 +911,9 @@ void usb_tx( uint32_t endpoint, usb_packet_t *packet ) 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_) - - // MCHCK Kiibohd Variant - // Check to see if PTA3 (has a pull-up) is connected to GND (usually via jumper) - // Only allow reload if the jumper is present (security) - GPIOA_PDDR &= ~(1<<3); // Input - PORTA_PCR3 = PORT_PCR_PFE | PORT_PCR_MUX(1); // Internal pull-up - - // Check for jumper - if ( GPIOA_PDIR & (1<<3) && flashModeEnabled_define != 0 ) - { - print( NL ); - warn_print("Security jumper not present, cancelling firmware reload..."); - info_msg("Replace jumper on middle 2 pins, or manually press the firmware reload button."); - } - else - { - // Copies variable into the VBAT register, must be identical to the variable in the bootloader to jump to the bootloader flash mode - for ( int pos = 0; pos < sizeof(sys_reset_to_loader_magic); pos++ ) - (&VBAT)[ pos ] = sys_reset_to_loader_magic[ pos ]; - SOFTWARE_RESET(); - } - // Kiibohd mk20dx256vlh7 -#elif defined(_mk20dx256vlh7_) +#if defined(_mk20dx128vlf5_) || defined(_mk20dx256vlh7_) // Copies variable into the VBAT register, must be identical to the variable in the bootloader to jump to the bootloader flash mode for ( int pos = 0; pos < sizeof(sys_reset_to_loader_magic); pos++ ) (&VBAT)[ pos ] = sys_reset_to_loader_magic[ pos ];