Home Alert System
Dependencies: PWM_Tone_Library DHT
M2XStreamClient/Utility.cpp@5:569a4894abc1, 2019-03-08 (annotated)
- Committer:
- aziz111
- Date:
- Fri Mar 08 17:15:02 2019 +0000
- Revision:
- 5:569a4894abc1
- Parent:
- 3:78f223d34f36
Final
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ethaderu | 3:78f223d34f36 | 1 | #include "Utility.h" |
ethaderu | 3:78f223d34f36 | 2 | |
ethaderu | 3:78f223d34f36 | 3 | void delay(int ms) { |
ethaderu | 3:78f223d34f36 | 4 | wait_ms(ms); |
ethaderu | 3:78f223d34f36 | 5 | } |
ethaderu | 3:78f223d34f36 | 6 | |
ethaderu | 3:78f223d34f36 | 7 | char* strdup(const char* s) { |
ethaderu | 3:78f223d34f36 | 8 | char* ret = (char*) malloc(strlen(s) + 1); |
ethaderu | 3:78f223d34f36 | 9 | if (ret == NULL) { return ret;} |
ethaderu | 3:78f223d34f36 | 10 | return strcpy(ret, s); |
ethaderu | 3:78f223d34f36 | 11 | } |