Skip to content

Commit

Permalink
- Fixed error with 0xFFFFFFFF
Browse files Browse the repository at this point in the history
  • Loading branch information
FlightControl-User committed Oct 8, 2023
1 parent a0b0223 commit df50572
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/cx16-smc.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ unsigned int smc_detect() {
*/
unsigned long smc_get_version_text(unsigned char* version_string, unsigned char release, unsigned char major, unsigned char minor) {

sprintf(version_string, "%u.%u.%u ", release, major, minor);
sprintf(version_string, "%u.%u.%u", release, major, minor);
return MAKELONG(MAKEWORD(minor, major), MAKEWORD(0, release));
}

Expand Down Expand Up @@ -301,7 +301,7 @@ unsigned int smc_flash(unsigned int smc_bytes_total) {
if(smc_attempts_flashed >= 10) {
sprintf(info_text, "There were too many attempts trying to flash the SMC at location %04x", smc_bytes_flashed);
display_action_text(info_text);
return 0xFFFFFFFF;
return (unsigned int)0xFFFF;
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/cx16-update.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,12 +352,12 @@ void main() {
// Flash the SMC chip.
display_action_text("Press both POWER/RESET buttons on the CX16 board!");
display_info_smc(STATUS_FLASHING, "Press POWER/RESET!");
unsigned long flashed_bytes = smc_flash(smc_file_size);
unsigned int flashed_bytes = smc_flash(smc_file_size);
if(flashed_bytes) {
// SF-1 | and POWER/RESET pressed
display_info_smc(STATUS_FLASHED, "");
} else {
if(flashed_bytes == (unsigned long)0xFFFFFFFF) {
if(flashed_bytes == (unsigned int)0xFFFF) {
// SF-3 | errors during flash
display_info_smc(STATUS_ERROR, "SMC has errors!");
} else {
Expand Down

0 comments on commit df50572

Please sign in to comment.