[FL-3351] github: re-enabled f18 build (#2743)
* github: re-enabled f18 build * scripts: storage: better transfer logging * Fix PVS warnings Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
		
							parent
							
								
									c186d2b0cc
								
							
						
					
					
						commit
						3226254876
					
				
							
								
								
									
										6
									
								
								.github/workflows/build.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								.github/workflows/build.yml
									
									
									
									
										vendored
									
									
								
							| @ -9,7 +9,7 @@ on: | |||||||
|   pull_request: |   pull_request: | ||||||
| 
 | 
 | ||||||
| env: | env: | ||||||
|   TARGETS: f7 |   TARGETS: f7 f18 | ||||||
|   DEFAULT_TARGET: f7 |   DEFAULT_TARGET: f7 | ||||||
|   FBT_TOOLCHAIN_PATH: /runner/_work |   FBT_TOOLCHAIN_PATH: /runner/_work | ||||||
| 
 | 
 | ||||||
| @ -96,8 +96,8 @@ jobs: | |||||||
|       - name: 'Copy map analyser files' |       - name: 'Copy map analyser files' | ||||||
|         if: ${{ !github.event.pull_request.head.repo.fork }} |         if: ${{ !github.event.pull_request.head.repo.fork }} | ||||||
|         run: | |         run: | | ||||||
|           cp build/f7-firmware-*/firmware.elf.map map_analyser_files/firmware.elf.map |           cp build/${DEFAULT_TARGET}-firmware-*/firmware.elf.map map_analyser_files/firmware.elf.map | ||||||
|           cp build/f7-firmware-*/firmware.elf map_analyser_files/firmware.elf |           cp build/${DEFAULT_TARGET}-firmware-*/firmware.elf map_analyser_files/firmware.elf | ||||||
|           cp ${{ github.event_path }} map_analyser_files/event.json |           cp ${{ github.event_path }} map_analyser_files/event.json | ||||||
| 
 | 
 | ||||||
|       - name: 'Analyse map file' |       - name: 'Analyse map file' | ||||||
|  | |||||||
| @ -50,7 +50,7 @@ static void nfc_scene_nfcv_emulate_widget_config(Nfc* nfc, bool data_received) { | |||||||
|     widget_add_icon_element(widget, 0, 3, &I_NFC_dolphin_emulation_47x61); |     widget_add_icon_element(widget, 0, 3, &I_NFC_dolphin_emulation_47x61); | ||||||
|     widget_add_string_multiline_element( |     widget_add_string_multiline_element( | ||||||
|         widget, 87, 13, AlignCenter, AlignTop, FontPrimary, "Emulating\nNFC V"); |         widget, 87, 13, AlignCenter, AlignTop, FontPrimary, "Emulating\nNFC V"); | ||||||
|     if(strcmp(nfc->dev->dev_name, "")) { |     if(strcmp(nfc->dev->dev_name, "") != 0) { | ||||||
|         furi_string_printf(info_str, "%s", nfc->dev->dev_name); |         furi_string_printf(info_str, "%s", nfc->dev->dev_name); | ||||||
|     } else { |     } else { | ||||||
|         for(uint8_t i = 0; i < data->uid_len; i++) { |         for(uint8_t i = 0; i < data->uid_len; i++) { | ||||||
|  | |||||||
| @ -808,7 +808,7 @@ static bool nfc_device_save_slix2_data(FlipperFormat* file, NfcDevice* dev) { | |||||||
|     return saved; |     return saved; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| bool nfc_device_load_slix2_data(FlipperFormat* file, NfcDevice* dev) { | bool nfc_device_load_slix2_data(FlipperFormat* file, NfcDevice* dev) { // -V524
 | ||||||
|     bool parsed = false; |     bool parsed = false; | ||||||
|     NfcVSlixData* data = &dev->dev_data.nfcv_data.sub_data.slix; |     NfcVSlixData* data = &dev->dev_data.nfcv_data.sub_data.slix; | ||||||
|     memset(data, 0, sizeof(NfcVSlixData)); |     memset(data, 0, sizeof(NfcVSlixData)); | ||||||
|  | |||||||
| @ -297,10 +297,10 @@ void nfc_worker_nfcv_unlock(NfcWorker* nfc_worker) { | |||||||
|                     ret = slix_unlock(nfcv_data, 4); |                     ret = slix_unlock(nfcv_data, 4); | ||||||
|                 } else { |                 } else { | ||||||
|                     key = 0x7FFD6E5B; |                     key = 0x7FFD6E5B; | ||||||
|                     key_data[0] = key >> 24; |                     key_data[0] = (key >> 24) & 0xFF; | ||||||
|                     key_data[1] = key >> 16; |                     key_data[1] = (key >> 16) & 0xFF; | ||||||
|                     key_data[2] = key >> 8; |                     key_data[2] = (key >> 8) & 0xFF; | ||||||
|                     key_data[3] = key >> 0; |                     key_data[3] = (key >> 0) & 0xFF; | ||||||
|                     ret = slix_unlock(nfcv_data, 4); |                     ret = slix_unlock(nfcv_data, 4); | ||||||
| 
 | 
 | ||||||
|                     if(ret != ERR_NONE) { |                     if(ret != ERR_NONE) { | ||||||
| @ -317,10 +317,10 @@ void nfc_worker_nfcv_unlock(NfcWorker* nfc_worker) { | |||||||
|                         } |                         } | ||||||
| 
 | 
 | ||||||
|                         key = 0x0F0F0F0F; |                         key = 0x0F0F0F0F; | ||||||
|                         key_data[0] = key >> 24; |                         key_data[0] = (key >> 24) & 0xFF; | ||||||
|                         key_data[1] = key >> 16; |                         key_data[1] = (key >> 16) & 0xFF; | ||||||
|                         key_data[2] = key >> 8; |                         key_data[2] = (key >> 8) & 0xFF; | ||||||
|                         key_data[3] = key >> 0; |                         key_data[3] = (key >> 0) & 0xFF; | ||||||
|                         ret = slix_unlock(nfcv_data, 4); |                         ret = slix_unlock(nfcv_data, 4); | ||||||
|                     } |                     } | ||||||
|                 } |                 } | ||||||
|  | |||||||
| @ -438,7 +438,7 @@ void nfcv_emu_send( | |||||||
|     furi_assert(nfcv); |     furi_assert(nfcv); | ||||||
| 
 | 
 | ||||||
|     /* picked default value (0) to match the most common format */ |     /* picked default value (0) to match the most common format */ | ||||||
|     if(!flags) { |     if(flags == NfcVSendFlagsNormal) { | ||||||
|         flags = NfcVSendFlagsSof | NfcVSendFlagsCrc | NfcVSendFlagsEof | |         flags = NfcVSendFlagsSof | NfcVSendFlagsCrc | NfcVSendFlagsEof | | ||||||
|                 NfcVSendFlagsOneSubcarrier | NfcVSendFlagsHighRate; |                 NfcVSendFlagsOneSubcarrier | NfcVSendFlagsHighRate; | ||||||
|     } |     } | ||||||
| @ -1326,7 +1326,7 @@ bool nfcv_emu_loop( | |||||||
|             bits_received += 2; |             bits_received += 2; | ||||||
| 
 | 
 | ||||||
|             if(periods == 1) { |             if(periods == 1) { | ||||||
|                 byte_value |= 0x00 << 6; |                 byte_value |= 0x00 << 6; // -V684
 | ||||||
|                 periods_previous = 6; |                 periods_previous = 6; | ||||||
|             } else if(periods == 3) { |             } else if(periods == 3) { | ||||||
|                 byte_value |= 0x01 << 6; |                 byte_value |= 0x01 << 6; | ||||||
|  | |||||||
| @ -381,7 +381,7 @@ void slix_prepare(NfcVData* nfcv_data) { | |||||||
|     ctx->emu_protocol_filter = &slix_protocol_filter; |     ctx->emu_protocol_filter = &slix_protocol_filter; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| bool slix2_protocol_filter( | bool slix2_protocol_filter( // -V524
 | ||||||
|     FuriHalNfcTxRxContext* tx_rx, |     FuriHalNfcTxRxContext* tx_rx, | ||||||
|     FuriHalNfcDevData* nfc_data, |     FuriHalNfcDevData* nfc_data, | ||||||
|     void* nfcv_data_in) { |     void* nfcv_data_in) { | ||||||
|  | |||||||
| @ -257,12 +257,12 @@ class FlipperStorage: | |||||||
|                 self.read.until(self.CLI_PROMPT) |                 self.read.until(self.CLI_PROMPT) | ||||||
| 
 | 
 | ||||||
|                 ftell = file.tell() |                 ftell = file.tell() | ||||||
|                 percent = str(math.ceil(ftell / filesize * 100)) |                 percent = math.ceil(ftell / filesize * 100) | ||||||
|                 total_chunks = str(math.ceil(filesize / buffer_size)) |                 total_chunks = math.ceil(filesize / buffer_size) | ||||||
|                 current_chunk = str(math.ceil(ftell / buffer_size)) |                 current_chunk = math.ceil(ftell / buffer_size) | ||||||
|                 approx_speed = ftell / (time.time() - start_time + 0.0001) |                 approx_speed = ftell / (time.time() - start_time + 0.0001) | ||||||
|                 sys.stdout.write( |                 sys.stdout.write( | ||||||
|                     f"\r{percent}%, chunk {current_chunk} of {total_chunks} @ {approx_speed/1024:.2f} kb/s" |                     f"\r<{percent:3d}%, chunk {current_chunk:2d} of {total_chunks:2d} @ {approx_speed/1024:.2f} kb/s" | ||||||
|                 ) |                 ) | ||||||
|                 sys.stdout.flush() |                 sys.stdout.flush() | ||||||
|         print() |         print() | ||||||
| @ -270,6 +270,7 @@ class FlipperStorage: | |||||||
|     def read_file(self, filename: str): |     def read_file(self, filename: str): | ||||||
|         """Receive file from Flipper, and get filedata (bytes)""" |         """Receive file from Flipper, and get filedata (bytes)""" | ||||||
|         buffer_size = self.chunk_size |         buffer_size = self.chunk_size | ||||||
|  |         start_time = time.time() | ||||||
|         self.send_and_wait_eol( |         self.send_and_wait_eol( | ||||||
|             'storage read_chunks "' + filename + '" ' + str(buffer_size) + "\r" |             'storage read_chunks "' + filename + '" ' + str(buffer_size) + "\r" | ||||||
|         ) |         ) | ||||||
| @ -290,10 +291,13 @@ class FlipperStorage: | |||||||
|             filedata.extend(self.port.read(chunk_size)) |             filedata.extend(self.port.read(chunk_size)) | ||||||
|             read_size = read_size + chunk_size |             read_size = read_size + chunk_size | ||||||
| 
 | 
 | ||||||
|             percent = str(math.ceil(read_size / size * 100)) |             percent = math.ceil(read_size / size * 100) | ||||||
|             total_chunks = str(math.ceil(size / buffer_size)) |             total_chunks = math.ceil(size / buffer_size) | ||||||
|             current_chunk = str(math.ceil(read_size / buffer_size)) |             current_chunk = math.ceil(read_size / buffer_size) | ||||||
|             sys.stdout.write(f"\r{percent}%, chunk {current_chunk} of {total_chunks}") |             approx_speed = read_size / (time.time() - start_time + 0.0001) | ||||||
|  |             sys.stdout.write( | ||||||
|  |                 f"\r>{percent:3d}%, chunk {current_chunk:2d} of {total_chunks:2d} @ {approx_speed/1024:.2f} kb/s" | ||||||
|  |             ) | ||||||
|             sys.stdout.flush() |             sys.stdout.flush() | ||||||
|         print() |         print() | ||||||
|         self.read.until(self.CLI_PROMPT) |         self.read.until(self.CLI_PROMPT) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 hedger
						hedger