This commit is contained in:
iceman1001 2023-07-06 22:37:34 +02:00
commit e43f6804a1
5 changed files with 775 additions and 771 deletions

View file

@ -407,9 +407,9 @@ static int bitparse_find_section(int bitstream_version, char section_name, uint3
current_length += get_from_fpga_stream(bitstream_version, compressed_fpga_stream, output_buffer) << 8;
current_length += get_from_fpga_stream(bitstream_version, compressed_fpga_stream, output_buffer) << 0;
numbytes += 4;
if (current_length > 300*1024) {
if (current_length > 300 * 1024) {
/* section e should never exceed about 300KB, if the length is too big limit it but still send the bitstream just in case */
current_length = 300*1024;
current_length = 300 * 1024;
}
break;
default: /* Two byte length field */

View file

@ -947,7 +947,7 @@ static int CmdTimeout(const char *Cmd) {
uint32_t oldTimeout = uart_get_timeouts();
// timeout is not given/invalid, just show the current timeout then return
if(arg < 0) {
if (arg < 0) {
PrintAndLogEx(INFO, "Current communication timeout: %ums", oldTimeout);
return PM3_SUCCESS;
}
@ -956,8 +956,7 @@ static int CmdTimeout(const char *Cmd) {
// UART_USB_CLIENT_RX_TIMEOUT_MS is considered as the minimum required timeout.
if (newTimeout < UART_USB_CLIENT_RX_TIMEOUT_MS) {
PrintAndLogEx(WARNING, "Timeout less than %ums might cause errors.", UART_USB_CLIENT_RX_TIMEOUT_MS);
}
else if(newTimeout > 5000) {
} else if (newTimeout > 5000) {
PrintAndLogEx(WARNING, "Timeout greater than 5000ms makes the client unresponsive.");
}
uart_reconfigure_timeouts(newTimeout);

View file

@ -213,9 +213,14 @@ clean:
help:
@echo "################################################################"
@echo "# Valid targets are: $(TARGETS)"
@echo "#"
@echo "# <target> - Builds only one of the above listed targets"
@echo "# all - Builds the FPGA bitstreams for all targets"
@echo "# clean - Keeps .bit files but cleans intermediate build files for all targets"
@echo "#"
@echo "#"
@echo "# Valid targets are:"
@echo "# $(TARGETS)"
@echo "#"
@echo "################################################################"

View file

@ -283,7 +283,7 @@ static int bitparse_find_section(FILE *infile, char section_name, unsigned int *
for (int i = 0; i < 4; i++) {
tmp = fgetc(infile);
/* image length sanity check, should be under 300KB */
if ( (tmp < 0) || (tmp > 300*1024) ) {
if ((tmp < 0) || (tmp > 300 * 1024)) {
break;
}
current_length += tmp << (24 - (i * 8));
@ -294,7 +294,7 @@ static int bitparse_find_section(FILE *infile, char section_name, unsigned int *
for (int i = 0; i < 2; i++) {
tmp = fgetc(infile);
/* if name, date or time fields are too long, we probably shouldn't parse them */
if ( (tmp < 0) || (tmp > 64) ){
if ((tmp < 0) || (tmp > 64)) {
break;
}
current_length += tmp << (8 - (i * 8));