Mercurial > public > ostc4
changeset 699:01f40cb1057e
Cleanup warnings:
The code still contained several warnings which have now been resolved. Big thank you to Thomas :-)
author | Ideenmodellierer |
---|---|
date | Tue, 18 Oct 2022 20:56:19 +0200 |
parents | 2c2b9c6eb089 |
children | c28c09017210 |
files | Common/CPU1-F429.ld Discovery/Inc/tInfo.h Discovery/Src/externCPU2bootloader.c Discovery/Src/gfx_engine.c Discovery/Src/simulation.c Discovery/Src/tInfo.c Discovery/Src/tMenuEditGasOC.c Discovery/Src/tMenuEditPlanner.c FontPack/base_upperRegion.c ostc4pack/src/OSTC4pack_V4.cpp ostc4pack/src/checksum_final_add_fletcher.cpp |
diffstat | 11 files changed, 36 insertions(+), 31 deletions(-) [+] |
line wrap: on
line diff
--- a/Common/CPU1-F429.ld Sun Sep 25 21:13:45 2022 +0200 +++ b/Common/CPU1-F429.ld Tue Oct 18 20:56:19 2022 +0200 @@ -48,8 +48,8 @@ /***************************** Memory Definition ****************************/ MEMORY { - ROM_BOOT (rx) : ORIGIN = 0x08000000, LENGTH = 0x00040000 /* 256K */ - ROM_MAIN (rx) : ORIGIN = 0x08040000, LENGTH = 0x00090000 /* 576K */ + ROM_BOOT (rx) : ORIGIN = 0x08000000, LENGTH = 0x00040000 /* 256K */ + ROM (rx) : ORIGIN = 0x08040000, LENGTH = 0x00090000 /* 576K */ UPPER(rx) : ORIGIN = 0x08132000, LENGTH = 0xAE270 /* 713K */ RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 192K CCRAM (rwx) : ORIGIN = 0x10000000, LENGTH = 64K
--- a/Discovery/Inc/tInfo.h Sun Sep 25 21:13:45 2022 +0200 +++ b/Discovery/Inc/tInfo.h Tue Oct 18 20:56:19 2022 +0200 @@ -61,7 +61,7 @@ void tInfo_setEvent(uint32_t inputEventID, uint32_t inputFunctionCall); -void tInfo_set_on_off(uint32_t editID, uint32_t int1); +void tInfo_set_on_off(uint32_t editID, uint8_t int1); void exitInfo(void); #endif /* TINFO_H */
--- a/Discovery/Src/externCPU2bootloader.c Sun Sep 25 21:13:45 2022 +0200 +++ b/Discovery/Src/externCPU2bootloader.c Tue Oct 18 20:56:19 2022 +0200 @@ -49,7 +49,7 @@ static void Bootloader_send_command(uint8_t command); static void Bootloader_spi_single(uint8_t TxByte); static void Bootloader_spi(uint16_t lengthData, uint8_t *aTxBuffer, uint8_t *aRxBuffer); -static void Bootloader_Error_Handler(void); +//static void Bootloader_Error_Handler(void); /* Exported functions --------------------------------------------------------*/ @@ -286,7 +286,9 @@ } +/* static void Bootloader_Error_Handler(void) { while(1); } +*/
--- a/Discovery/Src/gfx_engine.c Sun Sep 25 21:13:45 2022 +0200 +++ b/Discovery/Src/gfx_engine.c Tue Oct 18 20:56:19 2022 +0200 @@ -3053,7 +3053,7 @@ else pText = 0; } - if((*(char*)pText) & 0x80) + if(0 != pText && ((*(char*)pText) & 0x80)) { backup = pText; @@ -3159,6 +3159,7 @@ ptargetFont = (tFont *)cfg->font; } + decodeUTF8 = *(char*)pText; /* place ASCII char */ if((*(char*)pText == '\005') || (*(char*)pText == '\006')) { Xsum += 45; @@ -3920,15 +3921,15 @@ } if (!found && Font == &FontT54) { - Font = &FontT54Extra; + Font = (tFont *)&FontT54Extra; } else if (!found && (Font == &FontT84 || Font == &FontT84Spaced)) { - Font = &FontT84Extra; + Font = (tFont *)&FontT84Extra; } else if (!found && Font == &FontT105) { - Font = &FontT105Extra; + Font = (tFont *)&FontT105Extra; } return Font; @@ -3951,17 +3952,17 @@ if (Font == &FontT54) { found = 1; - Font = &FontT54Extra; + Font = (tFont *)&FontT54Extra; } else if (Font == &FontT84 || Font == &FontT84Spaced) { found = 1; - Font = &FontT84Extra; + Font = (tFont *)&FontT84Extra; } else if (Font == &FontT105) { found = 1; - Font = &FontT105Extra; + Font = (tFont *)&FontT105Extra; } if (found)
--- a/Discovery/Src/simulation.c Sun Sep 25 21:13:45 2022 +0200 +++ b/Discovery/Src/simulation.c Tue Oct 18 20:56:19 2022 +0200 @@ -131,7 +131,7 @@ static _Bool two_second = 0; static float lastPressure_bar = 0; - float localCalibCoeff[3]; + float localCalibCoeff[3] = { 0.0, 0.0, 0.0 }; uint8_t index, index2; if(checkOncePerSecond)
--- a/Discovery/Src/tInfo.c Sun Sep 25 21:13:45 2022 +0200 +++ b/Discovery/Src/tInfo.c Tue Oct 18 20:56:19 2022 +0200 @@ -52,7 +52,7 @@ { char orgText[32]; char newText[32]; - char input; + uint8_t input; char symbolCounter; int8_t begin[4], size[4]; uint16_t coord[3]; @@ -466,7 +466,7 @@ } -void tInfo_set_on_off(uint32_t editID, uint32_t int1) +void tInfo_set_on_off(uint32_t editID, uint8_t int1) { uint8_t backup_id, temp_id;
--- a/Discovery/Src/tMenuEditGasOC.c Sun Sep 25 21:13:45 2022 +0200 +++ b/Discovery/Src/tMenuEditGasOC.c Tue Oct 18 20:56:19 2022 +0200 @@ -181,7 +181,7 @@ { uint8_t setpoint; - editGasPage.pGasLine = stateUsed->diveSettings.gas; + editGasPage.pGasLine = (SGasLine *)stateUsed->diveSettings.gas; if(ccr) { @@ -215,7 +215,7 @@ uint8_t oxygen, helium, gasOffset, textpointer, lineCount, ptrGas; //SDiveState * pState; - editGasPage.pGasLine = stateUsed->diveSettings.gas; + editGasPage.pGasLine = (SGasLine *)stateUsed->diveSettings.gas; if(ccr) { editGasPage.setpoint = stateUsed->lifeData.actualGas.setPoint_cbar;
--- a/Discovery/Src/tMenuEditPlanner.c Sun Sep 25 21:13:45 2022 +0200 +++ b/Discovery/Src/tMenuEditPlanner.c Tue Oct 18 20:56:19 2022 +0200 @@ -304,7 +304,7 @@ text[2] = 0; write_label_var( 20, 800, y_line, &FontT48, text); - strncpy(text, + strcpy(text, " " "\016\016" " l/min" @@ -316,8 +316,7 @@ " " "\016\016" " l/min" - "\017", - 40 + "\017" ); write_label_var( 400, 800, y_line, &FontT48, text);
--- a/FontPack/base_upperRegion.c Sun Sep 25 21:13:45 2022 +0200 +++ b/FontPack/base_upperRegion.c Tue Oct 18 20:56:19 2022 +0200 @@ -115,7 +115,9 @@ #define ASSERT_RANGE(e, min, max) ASSERT(min <= e); ASSERT( e <= max) +#if DEBUG_STLINK_V2 extern void initialise_monitor_handles(void); +#endif static int errors = 0; static uint8_t errorflag = 0; @@ -149,7 +151,7 @@ for(const tFont* font = & __font_directory; font < &__font_directory_end; ++font) { - printf("Font: %x\n",font); + printf("Font: %x\n",(unsigned int)font); // Check END-OF-DIRECTORY magic marker if( font->length == (uint32_t)-1 ) { @@ -183,7 +185,7 @@ ASSERT(image->height == font->height); if(errorflag) { - printf("image %x: h=%d fonth=%d\n",image,image->height,font->height); + printf("image %x: h=%d fonth=%d\n",(unsigned int)image,image->height,font->height); errorflag = 0; } // Uncompress image bytes
--- a/ostc4pack/src/OSTC4pack_V4.cpp Sun Sep 25 21:13:45 2022 +0200 +++ b/ostc4pack/src/OSTC4pack_V4.cpp Tue Oct 18 20:56:19 2022 +0200 @@ -416,7 +416,7 @@ return(-1); } - FILE *fp, * fpout; + FILE *fp; size_t len; unsigned char buf[1050000]; char *file = argv[2]; @@ -424,7 +424,7 @@ unsigned int pruefsumme; //write File with length and cheksum - char filename[500], filenameout[510] ; + char filename[500], filenameout[511]; sprintf(filename,"%s",file); int filelength = strlen(filename); filename[filelength -4] = 0; @@ -435,7 +435,7 @@ return -1; } len = fread(buf, sizeof(char), sizeof(buf), fp); - printf("%d bytes read (hex: %#x )\n", len,len); + printf("%d bytes read (hex: %#x )\n", (uint32_t)len, (uint32_t)len); // unsigned int checksum = crc32c_checksum(buf, len); unsigned int checksum = CRC_CalcBlockCRC((uint32_t *)buf, (uint32_t)(len/4)); printf("The checksum of %s is %#x\n", file, checksum); @@ -455,7 +455,7 @@ buf2[1] = 0xFF & (len >> 16);; buf2[2] = 0xFF & (len >> 8); buf2[3] = 0xFF & len; - fpout = fopen(filenameout, "wb"); + fp = fopen(filenameout, "wb"); fwrite(buf2,sizeof(char),4,fp); @@ -505,7 +505,7 @@ for(int i = 0;i <len;i++) { - if(fwrite(&buf[i],1,1,fpout) != 1) + if(fwrite(&buf[i],1,1,fp) != 1) printf("error writing\n"); } @@ -516,5 +516,6 @@ buf2[3] = 0xFF & checksum; fwrite(buf2,sizeof(char),4,fp); - + + fclose(fp); }
--- a/ostc4pack/src/checksum_final_add_fletcher.cpp Sun Sep 25 21:13:45 2022 +0200 +++ b/ostc4pack/src/checksum_final_add_fletcher.cpp Tue Oct 18 20:56:19 2022 +0200 @@ -79,7 +79,7 @@ lenTemp = fread(&buf[lenTotal], sizeof(char), sizeof(buf), fp); // lenTemp = fread(buf, sizeof(char), sizeof(buf), fp); lenTotal = lenTemp; - printf("%d bytes read (hex: %#x )\n", lenTemp,lenTemp); + printf("%d bytes read (hex: %#x )\n", (uint32_t)lenTemp, (uint32_t)lenTemp); fclose(fp); if(file2) @@ -91,7 +91,7 @@ } lenTemp = fread(&buf[lenTotal], sizeof(char), sizeof(buf)-lenTotal, fp); lenTotal += lenTemp; - printf("%d bytes read (hex: %#x )\n", lenTemp,lenTemp); + printf("%d bytes read (hex: %#x )\n", (uint32_t)lenTemp, (uint32_t)lenTemp); fclose(fp); } if(file3) @@ -103,12 +103,12 @@ } lenTemp = fread(&buf[lenTotal], sizeof(char), sizeof(buf)-lenTotal, fp); lenTotal += lenTemp; - printf("%d bytes read (hex: %#x )\n", lenTemp,lenTemp); + printf("%d bytes read (hex: %#x )\n", (uint32_t)lenTemp, (uint32_t)lenTemp); fclose(fp); } printf("\n"); - printf("%d bytes read (hex: %#x ) total \n", lenTotal,lenTotal); + printf("%d bytes read (hex: %#x ) total \n", (uint32_t)lenTotal, (uint32_t)lenTotal); time_t rawtime; time (&rawtime);