Closed GoogleCodeExporter closed 8 years ago
I have mistaked the command,the correct command should be:
find . -name "*.c*" -exec sed -i "s/sleep(1);/usleep(1000000);/g" '{}' \;
Original comment by martonmi...@gmail.com
on 7 Nov 2013 at 6:57
You've got to be careful of running commands like that...
Example:
diff --git a/sample/xbee1/7.broadcast/main.c b/sample/xbee1/7.broadcast/main.c
index fd2ec34..87329b4 100644
--- a/sample/xbee1/7.broadcast/main.c
+++ b/sample/xbee1/7.broadcast/main.c
@@ -62,7 +62,7 @@ int main(void) {
xbee_conTx(con, NULL, "%d\r\n", i);
/* XBee Series 1 modules don't use meshing, so you can broadcast much faster than Series 2 */
- usleep(10000); /* 10ms */
+ uusleep(10000000000); /* 10ms */
}
if ((ret = xbee_conEnd(con)) != XBEE_ENONE) {
Also, it's worth noting that usleep() isn't always suitable for times greater
than 1 second:
"The type useconds_t shall be an unsigned integer type capable of storing
values at least in the range [0, 1000000]."
I have however made this change.
Original comment by attie@attie.co.uk
on 7 Nov 2013 at 8:45
Original issue reported on code.google.com by
martonmi...@gmail.com
on 7 Nov 2013 at 6:33