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.
Diff: CommandPool.cpp
- Revision:
- 4:014c83243d70
- Parent:
- 3:b83fb41e2726
- Child:
- 5:7fa548878fac
--- a/CommandPool.cpp Sat Nov 28 02:34:45 2015 +0000
+++ b/CommandPool.cpp Sat Nov 28 15:21:24 2015 +0000
@@ -31,9 +31,14 @@
Command* CommandPool::getCommand(const char& cmdstr)
{
- static char cmd = cmdstr & 0x0F;
- static int8_t is_negative = cmdstr & 0x08;
- static int8_t sp = (cmdstr & 0xF0) >> 4;
+ static char cmd = '\0';
+ static int8_t is_negative = 0;
+ static int8_t sp = 0; (cmdstr & 0xF0) >> 4;
+
+ cmd = cmdstr & 0x0F;
+ is_negative = (cmdstr & 0x08) >> 3;
+ sp = (cmdstr & 0xF0) >> 4;
+
_pool[cmd]->setSpeed(sp,is_negative);
return _pool[cmd];
}
\ No newline at end of file