@@ -87,7 +87,7 @@ void supervisor_start_bluetooth(void) {
87
87
characteristic_list .items = characteristic_list_items ;
88
88
mp_seq_clear (characteristic_list .items , 0 , characteristic_list .alloc , sizeof (* characteristic_list .items ));
89
89
90
- const uint32_t err_code = _common_hal_bleio_service_construct (& supervisor_ble_service , & supervisor_ble_service_uuid , false /* is secondary */ , & characteristic_list );
90
+ _common_hal_bleio_service_construct (& supervisor_ble_service , & supervisor_ble_service_uuid , false /* is secondary */ , & characteristic_list );
91
91
92
92
// File length
93
93
supervisor_ble_version_uuid .base .type = & bleio_uuid_type ;
@@ -186,7 +186,7 @@ void open_current_file(void) {
186
186
path [length ] = '\0' ;
187
187
188
188
FATFS * fs = & ((fs_user_mount_t * ) MP_STATE_VM (vfs_mount_table )-> obj )-> fatfs ;
189
- FRESULT result = f_open (fs , & active_file , (char * ) path , FA_READ | FA_WRITE );
189
+ f_open (fs , & active_file , (char * ) path , FA_READ | FA_WRITE );
190
190
191
191
update_file_length ();
192
192
}
@@ -246,40 +246,39 @@ void supervisor_bluetooth_background(void) {
246
246
//uint32_t data_shift_length = fileLength - offset - remove_length;
247
247
int32_t data_shift = insert_length - remove_length ;
248
248
uint32_t new_length = file_length + data_shift ;
249
- FRESULT result ;
250
249
251
250
// TODO: Make these loops smarter to read and write on sector boundaries.
252
251
if (data_shift < 0 ) {
253
252
for (uint32_t shift_offset = offset + insert_length ; shift_offset < new_length ; shift_offset ++ ) {
254
253
uint8_t data ;
255
254
UINT actual ;
256
255
f_lseek (& active_file , shift_offset - data_shift );
257
- result = f_read (& active_file , & data , 1 , & actual );
256
+ f_read (& active_file , & data , 1 , & actual );
258
257
f_lseek (& active_file , shift_offset );
259
- result = f_write (& active_file , & data , 1 , & actual );
258
+ f_write (& active_file , & data , 1 , & actual );
260
259
}
261
260
f_truncate (& active_file );
262
261
} else if (data_shift > 0 ) {
263
- result = f_lseek (& active_file , file_length );
262
+ f_lseek (& active_file , file_length );
264
263
// Fill end with 0xff so we don't need to erase.
265
264
uint8_t data = 0xff ;
266
265
for (size_t i = 0 ; i < (size_t ) data_shift ; i ++ ) {
267
266
UINT actual ;
268
- result = f_write (& active_file , & data , 1 , & actual );
267
+ f_write (& active_file , & data , 1 , & actual );
269
268
}
270
269
for (uint32_t shift_offset = new_length - 1 ; shift_offset >= offset + insert_length ; shift_offset -- ) {
271
270
UINT actual ;
272
271
f_lseek (& active_file , shift_offset - data_shift );
273
- result = f_read (& active_file , & data , 1 , & actual );
272
+ f_read (& active_file , & data , 1 , & actual );
274
273
f_lseek (& active_file , shift_offset );
275
- result = f_write (& active_file , & data , 1 , & actual );
274
+ f_write (& active_file , & data , 1 , & actual );
276
275
}
277
276
}
278
277
279
278
f_lseek (& active_file , offset );
280
279
uint8_t * data = (uint8_t * ) (current_command + 4 );
281
280
UINT written ;
282
- result = f_write (& active_file , data , insert_length , & written );
281
+ f_write (& active_file , data , insert_length , & written );
283
282
f_sync (& active_file );
284
283
// Notify the new file length.
285
284
update_file_length ();
0 commit comments