From 0ed5b84ee9d1f76e38552f084c27534bd757a522 Mon Sep 17 00:00:00 2001 From: James Cotton Date: Wed, 25 Jul 2012 14:41:10 -0500 Subject: [PATCH] Move the try catch when parsing overo files --- .../src/plugins/uavobjects/uavobjecttemplate.m | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/uavobjects/uavobjecttemplate.m b/ground/openpilotgcs/src/plugins/uavobjects/uavobjecttemplate.m index 0f9ead8a5..3dd62df2f 100644 --- a/ground/openpilotgcs/src/plugins/uavobjects/uavobjecttemplate.m +++ b/ground/openpilotgcs/src/plugins/uavobjects/uavobjecttemplate.m @@ -75,14 +75,15 @@ startTime=clock; while (1) if (feof(fid)); break; end + try %% Read message header % get sync field (0x3C, 1 byte) sync = fread(fid, 1, 'uint8'); if sync ~= correctSyncByte - prebuf = [prebuf(2:end); sync]; - wrongSyncByte = wrongSyncByte + 1; - continue - end + prebuf = [prebuf(2:end); sync]; + wrongSyncByte = wrongSyncByte + 1; + continue + end % get msg type (quint8 1 byte ) should be 0x20, ignore the rest? msgType = fread(fid, 1, 'uint8'); @@ -109,7 +110,7 @@ while (1) end %% Read object - try + switch objID $(SWITCHCODE) otherwise