- case CMD_START_FLASH: {
- if(c->arg[2] == START_FLASH_MAGIC) bootrom_unlocked = 1;
- else bootrom_unlocked = 0;
- {
- int prot_start = (int)&_bootrom_start;
- int prot_end = (int)&_bootrom_end;
- int allow_start = (int)&_flash_start;
- int allow_end = (int)&_flash_end;
- int cmd_start = c->arg[0];
- int cmd_end = c->arg[1];
-
- /* Only allow command if the bootrom is unlocked, or the parameters are outside of the protected
- * bootrom area. In any case they must be within the flash area.
- */
- if( (bootrom_unlocked || ((cmd_start >= prot_end) || (cmd_end < prot_start)))
- && (cmd_start >= allow_start) && (cmd_end <= allow_end) ) {
- start_addr = cmd_start;
- end_addr = cmd_end;
- } else {
- start_addr = end_addr = 0;
- dont_ack = 1;
-// c->cmd = CMD_NACK;
-// UsbSendPacket(packet, len);
- cmd_send(CMD_NACK,0,0,0,0,0);
- }
- }
- } break;
+ case CMD_START_FLASH: {
+ if(c->arg[2] == START_FLASH_MAGIC)
+ bootrom_unlocked = 1;
+ else
+ bootrom_unlocked = 0;
+
+ int prot_start = (int)&_bootrom_start;
+ int prot_end = (int)&_bootrom_end;
+ int allow_start = (int)&_flash_start;
+ int allow_end = (int)&_flash_end;
+ int cmd_start = c->arg[0];
+ int cmd_end = c->arg[1];
+
+ /* Only allow command if the bootrom is unlocked, or the parameters are outside of the protected
+ * bootrom area. In any case they must be within the flash area.
+ */
+ if( (bootrom_unlocked || ((cmd_start >= prot_end) || (cmd_end < prot_start))) &&
+ (cmd_start >= allow_start) &&
+ (cmd_end <= allow_end) ) {
+ start_addr = cmd_start;
+ end_addr = cmd_end;
+ } else {
+ start_addr = end_addr = 0;
+ dont_ack = 1;
+ cmd_send(CMD_NACK,0,0,0,0,0);
+ }
+ } break;