Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 2:ca608c24a14e, committed 2014-11-05
- Comitter:
- sawa
- Date:
- Wed Nov 05 08:47:14 2014 +0000
- Parent:
- 1:4b239aea14f4
- Commit message:
- add error check at init
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Wed Nov 05 07:36:23 2014 +0000
+++ b/main.cpp Wed Nov 05 08:47:14 2014 +0000
@@ -136,8 +136,13 @@
}
// initialize XBus Servos
- for (counter = 0; counter < kMaxServoNum; counter++)
- gXBus.addServo(servoChannel[counter], kXbusServoNeutral);
+ for (counter = 0; counter < kMaxServoNum; counter++) {
+ result = gXBus.addServo(servoChannel[counter], kXbusServoNeutral);
+ if (result != kXBusError_NoError) {
+ gXBus.stop();
+ return result;
+ }
+ }
return kXBusError_NoError;
}