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 4:e64524a61cfe, committed 2015-12-04
- Comitter:
- sype
- Date:
- Fri Dec 04 11:18:01 2015 +0000
- Parent:
- 3:5c6a9045c8f7
- Child:
- 5:ad00b3431ff5
- Commit message:
- 80% motorisation
Changed in this revision
| RoboClaw.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/RoboClaw.cpp Tue Nov 24 21:56:10 2015 +0000
+++ b/RoboClaw.cpp Fri Dec 04 11:18:01 2015 +0000
@@ -1,7 +1,7 @@
#include "RoboClaw.h"
#include <stdarg.h>
-#define MAXTRY 2
+#define MAXTRY 1
#define SetDWORDval(arg) (uint8_t)(arg>>24),(uint8_t)(arg>>16),(uint8_t)(arg>>8),(uint8_t)arg
#define SetWORDval(arg) (uint8_t)(arg>>8),(uint8_t)arg
@@ -29,8 +29,8 @@
}
void RoboClaw::write_n(uint8_t cnt, ... ){
- uint8_t retry = MAXTRY;
- do {
+ //uint8_t retry = MAXTRY;
+ //do {
crc_clear();
va_list marker;
va_start( marker, cnt );
@@ -43,7 +43,7 @@
uint16_t crc = crc_get();
_roboclaw.putc(crc>>8);
_roboclaw.putc(crc);
- } while(retry--);
+ //} while(_roboclaw.getc() != 0xFF);
}
void RoboClaw::write_(uint8_t address, uint8_t command, uint8_t data, bool reading, bool crcon){