Mercurial > public > ostc4
comparison Discovery/Src/show_logbook.c @ 994:bad5561c0c59 GasConsumption
Fix a compilation error occurring on non-Windows platforms, caused by incorrect case in '#include' file names.
Also fix some compiler warnings from non-safe use of 'memcpy'. (mikeller)
| author | heinrichsweikamp |
|---|---|
| date | Sun, 27 Apr 2025 09:56:22 +0200 |
| parents | d9290c76b840 |
| children | b0d3e8b84966 |
comparison
equal
deleted
inserted
replaced
| 993:df052f0347fb | 994:bad5561c0c59 |
|---|---|
| 895 { | 895 { |
| 896 releaseFrame(16,tLOGscreen.FBStartAdress); | 896 releaseFrame(16,tLOGscreen.FBStartAdress); |
| 897 releaseFrame(17,tLOGbackground.FBStartAdress); | 897 releaseFrame(17,tLOGbackground.FBStartAdress); |
| 898 } | 898 } |
| 899 | 899 |
| 900 #define MSG_LENGTH 30 | |
| 900 | 901 |
| 901 static void show_logbook_logbook_show_log_page3(GFX_DrawCfgScreen *hgfx, uint8_t StepBackwards) | 902 static void show_logbook_logbook_show_log_page3(GFX_DrawCfgScreen *hgfx, uint8_t StepBackwards) |
| 902 { | 903 { |
| 903 SWindowGimpStyle wintemp; | 904 SWindowGimpStyle wintemp; |
| 904 SWindowGimpStyle winsmal; | 905 SWindowGimpStyle winsmal; |
| 917 uint16_t dataLength = 0; | 918 uint16_t dataLength = 0; |
| 918 uint16_t depthdata[1000]; | 919 uint16_t depthdata[1000]; |
| 919 uint8_t gasdata[1000]; | 920 uint8_t gasdata[1000]; |
| 920 dataLength = logbook_readSampleData(StepBackwards, 1000, depthdata,gasdata, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); | 921 dataLength = logbook_readSampleData(StepBackwards, 1000, depthdata,gasdata, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); |
| 921 | 922 |
| 922 char msg[15]; | 923 char msg[MSG_LENGTH]; |
| 923 char gas_name[15]; | 924 char gas_name[15]; |
| 924 int j = 0; | 925 int j = 0; |
| 925 | 926 |
| 926 loopMode = isLoopMode(logbookHeader.diveMode); | 927 loopMode = isLoopMode(logbookHeader.diveMode); |
| 927 | 928 |
| 977 if(loopMode) | 978 if(loopMode) |
| 978 { | 979 { |
| 979 if(index < NUM_GASES) /* Switch to Bailout is not covered by log gas list */ | 980 if(index < NUM_GASES) /* Switch to Bailout is not covered by log gas list */ |
| 980 { | 981 { |
| 981 snprintf(gas_name,15,"Bailout"); | 982 snprintf(gas_name,15,"Bailout"); |
| 982 snprintf(msg,15,"G%d: %s",index +1, gas_name); | 983 snprintf(msg, MSG_LENGTH, "G%d: %s", index +1, gas_name); |
| 983 } | 984 } |
| 984 else | 985 else |
| 985 { | 986 { |
| 986 print_gas_name(gas_name,15,logbookHeader.gasordil[index-NUM_GASES].oxygen_percentage,logbookHeader.gasordil[index-NUM_GASES].helium_percentage); | 987 print_gas_name(gas_name,15,logbookHeader.gasordil[index-NUM_GASES].oxygen_percentage,logbookHeader.gasordil[index-NUM_GASES].helium_percentage); |
| 987 snprintf(msg,15,"D%d: %s",index +1 - NUM_GASES, gas_name); | 988 snprintf(msg, MSG_LENGTH, "D%d: %s", index + 1 - NUM_GASES, gas_name); |
| 988 } | 989 } |
| 989 } | 990 } |
| 990 else | 991 else |
| 991 { | 992 { |
| 992 print_gas_name(gas_name,15,logbookHeader.gasordil[index].oxygen_percentage,logbookHeader.gasordil[index].helium_percentage); | 993 print_gas_name(gas_name,15,logbookHeader.gasordil[index].oxygen_percentage,logbookHeader.gasordil[index].helium_percentage); |
| 993 snprintf(msg,15,"G%d: %s",index +1, gas_name); | 994 snprintf(msg, MSG_LENGTH, "G%d: %s", index + 1, gas_name); |
| 994 } | 995 } |
| 995 Gfx_write_label_var(hgfx, winsmal.left, winsmal.right,winsmal.top, &FontT24,color,msg); | 996 Gfx_write_label_var(hgfx, winsmal.left, winsmal.right,winsmal.top, &FontT24,color,msg); |
| 996 } | 997 } |
| 997 } | 998 } |
| 998 | 999 |
