Fork of M2XStreamClient by
Utility.cpp@5:ea68c8980ad8, 2013-10-24 (annotated)
- Committer:
- citrusbyte
- Date:
- Thu Oct 24 12:22:33 2013 +0000
- Revision:
- 5:ea68c8980ad8
Initial commit for M2X mbed client library
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
citrusbyte | 5:ea68c8980ad8 | 1 | #include "Utility.h" |
citrusbyte | 5:ea68c8980ad8 | 2 | |
citrusbyte | 5:ea68c8980ad8 | 3 | void delay(int ms) { |
citrusbyte | 5:ea68c8980ad8 | 4 | wait_ms(ms); |
citrusbyte | 5:ea68c8980ad8 | 5 | } |
citrusbyte | 5:ea68c8980ad8 | 6 | |
citrusbyte | 5:ea68c8980ad8 | 7 | char* strdup(const char* s) { |
citrusbyte | 5:ea68c8980ad8 | 8 | char* ret = (char*) malloc(strlen(s) + 1); |
citrusbyte | 5:ea68c8980ad8 | 9 | if (ret == NULL) { return ret;} |
citrusbyte | 5:ea68c8980ad8 | 10 | return strcpy(ret, s); |
citrusbyte | 5:ea68c8980ad8 | 11 | } |
citrusbyte | 5:ea68c8980ad8 | 12 |