Skip to content

Commit

Permalink
some assert changes in vfs mgr
Browse files Browse the repository at this point in the history
  • Loading branch information
MightyPork committed Dec 17, 2017
1 parent 9c37afe commit 26aea32
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions vfs/vfs_manager.c
Expand Up @@ -19,7 +19,6 @@
* limitations under the License.
*/

#include <task_main.h>
#include "platform.h"
#include "task_main.h"
#include "virtual_fs.h"
Expand Down Expand Up @@ -632,7 +631,7 @@ static bool ready_for_state_change(void)
break;

default:
assert_param(0);
trap("Bad xfer state");
timeout_ms = DISCONNECT_DELAY_MS;
break;
}
Expand All @@ -648,7 +647,7 @@ static bool ready_for_state_change(void)
}

if (INVALID_TIMEOUT_MS == timeout_ms) {
assert_param(0);
trap("invalid timeout");
timeout_ms = 0;
}

Expand All @@ -674,7 +673,7 @@ static void transfer_update_file_info(vfs_file_t file, uint32_t start_sector, ui
vfs_printf("\033[33m@transfer_update_file_info\033[0m (file=%p, start_sector=%i, size=%i)\r\n", file, start_sector, size);

if (TRASNFER_FINISHED == file_transfer_state.transfer_state) {
assert_param(0);
trap("xfer already finished");
return;
}

Expand Down Expand Up @@ -718,7 +717,7 @@ static void transfer_update_file_info(vfs_file_t file, uint32_t start_sector, ui
vfs_printf(" error: starting sector changed from %i to %i\r\n", file_transfer_state.start_sector, start_sector);
// this is probably a new file

trap("Changed start offset");//XXX
trap("Changed start offset");//FIXME this sometimes happens, need to find how to reproduce
switch_to_new_file(stream, start_sector, true);
}

Expand Down Expand Up @@ -813,7 +812,7 @@ static void transfer_stream_data(uint32_t sector, const uint8_t *data, uint32_t
file_transfer_state.size_processed, data[0], data[1], data[2], data[3]);

if (file_transfer_state.stream_finished) {
assert_param(0);
trap("Stream already closed");
return;
}

Expand Down Expand Up @@ -854,7 +853,7 @@ static void transfer_update_state(error_t status)
(status != E_SUCCESS_DONE_OR_CONTINUE));

if (TRASNFER_FINISHED == file_transfer_state.transfer_state) {
assert_param(0);
trap("Xfer already closed");
return;
}

Expand Down

0 comments on commit 26aea32

Please sign in to comment.