Skip to content

Commit

Permalink
fix regulatory text preparation
Browse files Browse the repository at this point in the history
  • Loading branch information
gardners committed Mar 6, 2017
1 parent b981ca8 commit f013768
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,15 @@ int eeprom_program(int argc,char **argv)
=configuration_directives_input[i];
}

// Set actual radio parameters
radio_parameters.frequency=atoi(argv[5]);
radio_parameters.txpower=atoi(argv[6]?argv[6]:"0");
radio_parameters.dutycycle=atoi(argv[7]?argv[7]:"0");
radio_parameters.airspeed=atoi(argv[8]?argv[8]:"0");
radio_parameters.primary_country[0]=argv[9][0];
radio_parameters.primary_country[1]=argv[9][1];
radio_parameters.lock_firmware=argv[10][0];

// Generate default regulatory information, if required
if (!regulatory_information_input[0]) {
generate_regulatory_information(regulatory_information,
Expand All @@ -682,15 +691,6 @@ int eeprom_program(int argc,char **argv)
strcpy(configuration_directives_normalised,
configuration_directives);
}

// But always replace radio parameters
radio_parameters.frequency=atoi(argv[5]);
radio_parameters.txpower=atoi(argv[6]?argv[6]:"0");
radio_parameters.dutycycle=atoi(argv[7]?argv[7]:"0");
radio_parameters.airspeed=atoi(argv[8]?argv[8]:"0");
radio_parameters.primary_country[0]=argv[9][0];
radio_parameters.primary_country[1]=argv[9][1];
radio_parameters.lock_firmware=argv[10][0];

if (eeprom_build_image(configuration_directives_normalised,
regulatory_information,
Expand Down
4 changes: 2 additions & 2 deletions regulatory.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ int generate_regulatory_information(char *out,int max_len,char *primary_country,
append_string(out,&offset,max_len,piece);
}
append_string(out,&offset,max_len,"</table>\n\n");
snprintf(piece,1024,"<p class=radioparameters>The radio is configured to operate at %ul Hz, with a transmit power of %d dBm, and a maximum duty cycle of %d %%.\n",
frequency,max_txpower,duty_cycle);
snprintf(piece,1024,"<p class=radioparameters>The radio is configured to operate at %u Hz, with a transmit power of %d dBm, and a maximum duty cycle of %d %%.\n",
(unsigned)frequency,max_txpower,duty_cycle);
append_string(out,&offset,max_len,piece);

out[offset]=0; return 0;
Expand Down

0 comments on commit f013768

Please sign in to comment.