diff options
| author | Scott Shawcroft <scott@tannewt.org> | 2019-10-22 17:24:04 -0700 |
|---|---|---|
| committer | Scott Shawcroft <scott@tannewt.org> | 2019-10-22 17:24:04 -0700 |
| commit | ece8352126e34c5437080e9343f469f2f5e1bfe9 (patch) | |
| tree | 45e56fd7802a6e2810ce5d02940c7ff7813cc05b | |
| parent | aeee15eae8dc83f2947ac57ca868e439a15bf84b (diff) | |
Fix build by removing unused vars
| -rw-r--r-- | shared-module/_bleio/ScanResults.c | 5 | ||||
| -rw-r--r-- | supervisor/shared/bluetooth.c | 19 |
2 files changed, 12 insertions, 12 deletions
diff --git a/shared-module/_bleio/ScanResults.c b/shared-module/_bleio/ScanResults.c index 9f23a836c..7ea0c165f 100644 --- a/shared-module/_bleio/ScanResults.c +++ b/shared-module/_bleio/ScanResults.c @@ -28,6 +28,7 @@ #include <string.h> +#include "lib/utils/interrupt_char.h" #include "py/objstr.h" #include "py/runtime.h" #include "shared-bindings/_bleio/ScanEntry.h" @@ -44,10 +45,10 @@ bleio_scanresults_obj_t* shared_module_bleio_new_scanresults(size_t buffer_size, } mp_obj_t common_hal_bleio_scanresults_next(bleio_scanresults_obj_t *self) { - while (ringbuf_count(&self->buf) == 0 && !self->done && !mp_exception_pending()) { + while (ringbuf_count(&self->buf) == 0 && !self->done && !mp_hal_is_interrupted()) { RUN_BACKGROUND_TASKS; } - if (ringbuf_count(&self->buf) == 0 || mp_exception_pending()) { + if (ringbuf_count(&self->buf) == 0 || mp_hal_is_interrupted()) { return mp_const_none; } diff --git a/supervisor/shared/bluetooth.c b/supervisor/shared/bluetooth.c index 64f3b55eb..02258de74 100644 --- a/supervisor/shared/bluetooth.c +++ b/supervisor/shared/bluetooth.c @@ -87,7 +87,7 @@ void supervisor_start_bluetooth(void) { characteristic_list.items = characteristic_list_items; mp_seq_clear(characteristic_list.items, 0, characteristic_list.alloc, sizeof(*characteristic_list.items)); - const uint32_t err_code = _common_hal_bleio_service_construct(&supervisor_ble_service, &supervisor_ble_service_uuid, false /* is secondary */, &characteristic_list); + _common_hal_bleio_service_construct(&supervisor_ble_service, &supervisor_ble_service_uuid, false /* is secondary */, &characteristic_list); // File length supervisor_ble_version_uuid.base.type = &bleio_uuid_type; @@ -186,7 +186,7 @@ void open_current_file(void) { path[length] = '\0'; FATFS *fs = &((fs_user_mount_t *) MP_STATE_VM(vfs_mount_table)->obj)->fatfs; - FRESULT result = f_open(fs, &active_file, (char*) path, FA_READ | FA_WRITE); + f_open(fs, &active_file, (char*) path, FA_READ | FA_WRITE); update_file_length(); } @@ -246,7 +246,6 @@ void supervisor_bluetooth_background(void) { //uint32_t data_shift_length = fileLength - offset - remove_length; int32_t data_shift = insert_length - remove_length; uint32_t new_length = file_length + data_shift; - FRESULT result; // TODO: Make these loops smarter to read and write on sector boundaries. if (data_shift < 0) { @@ -254,32 +253,32 @@ void supervisor_bluetooth_background(void) { uint8_t data; UINT actual; f_lseek(&active_file, shift_offset - data_shift); - result = f_read(&active_file, &data, 1, &actual); + f_read(&active_file, &data, 1, &actual); f_lseek(&active_file, shift_offset); - result = f_write(&active_file, &data, 1, &actual); + f_write(&active_file, &data, 1, &actual); } f_truncate(&active_file); } else if (data_shift > 0) { - result = f_lseek(&active_file, file_length); + f_lseek(&active_file, file_length); // Fill end with 0xff so we don't need to erase. uint8_t data = 0xff; for (size_t i = 0; i < (size_t) data_shift; i++) { UINT actual; - result = f_write(&active_file, &data, 1, &actual); + f_write(&active_file, &data, 1, &actual); } for (uint32_t shift_offset = new_length - 1; shift_offset >= offset + insert_length ; shift_offset--) { UINT actual; f_lseek(&active_file, shift_offset - data_shift); - result = f_read(&active_file, &data, 1, &actual); + f_read(&active_file, &data, 1, &actual); f_lseek(&active_file, shift_offset); - result = f_write(&active_file, &data, 1, &actual); + f_write(&active_file, &data, 1, &actual); } } f_lseek(&active_file, offset); uint8_t* data = (uint8_t *) (current_command + 4); UINT written; - result = f_write(&active_file, data, insert_length, &written); + f_write(&active_file, data, insert_length, &written); f_sync(&active_file); // Notify the new file length. update_file_length(); |
