Skip to content

Commit ece8352

Browse files
committed
Fix build by removing unused vars
1 parent aeee15e commit ece8352

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

shared-module/_bleio/ScanResults.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
#include <string.h>
3030

31+
#include "lib/utils/interrupt_char.h"
3132
#include "py/objstr.h"
3233
#include "py/runtime.h"
3334
#include "shared-bindings/_bleio/ScanEntry.h"
@@ -44,10 +45,10 @@ bleio_scanresults_obj_t* shared_module_bleio_new_scanresults(size_t buffer_size,
4445
}
4546

4647
mp_obj_t common_hal_bleio_scanresults_next(bleio_scanresults_obj_t *self) {
47-
while (ringbuf_count(&self->buf) == 0 && !self->done && !mp_exception_pending()) {
48+
while (ringbuf_count(&self->buf) == 0 && !self->done && !mp_hal_is_interrupted()) {
4849
RUN_BACKGROUND_TASKS;
4950
}
50-
if (ringbuf_count(&self->buf) == 0 || mp_exception_pending()) {
51+
if (ringbuf_count(&self->buf) == 0 || mp_hal_is_interrupted()) {
5152
return mp_const_none;
5253
}
5354

supervisor/shared/bluetooth.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ void supervisor_start_bluetooth(void) {
8787
characteristic_list.items = characteristic_list_items;
8888
mp_seq_clear(characteristic_list.items, 0, characteristic_list.alloc, sizeof(*characteristic_list.items));
8989

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);
9191

9292
// File length
9393
supervisor_ble_version_uuid.base.type = &bleio_uuid_type;
@@ -186,7 +186,7 @@ void open_current_file(void) {
186186
path[length] = '\0';
187187

188188
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);
190190

191191
update_file_length();
192192
}
@@ -246,40 +246,39 @@ void supervisor_bluetooth_background(void) {
246246
//uint32_t data_shift_length = fileLength - offset - remove_length;
247247
int32_t data_shift = insert_length - remove_length;
248248
uint32_t new_length = file_length + data_shift;
249-
FRESULT result;
250249

251250
// TODO: Make these loops smarter to read and write on sector boundaries.
252251
if (data_shift < 0) {
253252
for (uint32_t shift_offset = offset + insert_length; shift_offset < new_length; shift_offset++) {
254253
uint8_t data;
255254
UINT actual;
256255
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);
258257
f_lseek(&active_file, shift_offset);
259-
result = f_write(&active_file, &data, 1, &actual);
258+
f_write(&active_file, &data, 1, &actual);
260259
}
261260
f_truncate(&active_file);
262261
} else if (data_shift > 0) {
263-
result = f_lseek(&active_file, file_length);
262+
f_lseek(&active_file, file_length);
264263
// Fill end with 0xff so we don't need to erase.
265264
uint8_t data = 0xff;
266265
for (size_t i = 0; i < (size_t) data_shift; i++) {
267266
UINT actual;
268-
result = f_write(&active_file, &data, 1, &actual);
267+
f_write(&active_file, &data, 1, &actual);
269268
}
270269
for (uint32_t shift_offset = new_length - 1; shift_offset >= offset + insert_length ; shift_offset--) {
271270
UINT actual;
272271
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);
274273
f_lseek(&active_file, shift_offset);
275-
result = f_write(&active_file, &data, 1, &actual);
274+
f_write(&active_file, &data, 1, &actual);
276275
}
277276
}
278277

279278
f_lseek(&active_file, offset);
280279
uint8_t* data = (uint8_t *) (current_command + 4);
281280
UINT written;
282-
result = f_write(&active_file, data, insert_length, &written);
281+
f_write(&active_file, data, insert_length, &written);
283282
f_sync(&active_file);
284283
// Notify the new file length.
285284
update_file_length();

0 commit comments

Comments
 (0)