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.
Dependencies: BSP_DISCO_L476VG COMPASS_DISCO_L476VG ConfigFile GYRO_DISCO_L476VG SDFileSystem mbed
util.h
00001 #ifndef UTIL 00002 #define UTIL 00003 #include "mbed.h" 00004 00005 /* 00006 ** reverse string in place 00007 */ 00008 void reverse(char *s) { 00009 char *j; 00010 int c; 00011 00012 j = s + strlen(s) - 1; 00013 while(s < j) { 00014 c = *s; 00015 *s++ = *j; 00016 *j-- = c; 00017 } 00018 } 00019 00020 void itoa(int n, char s[]) 00021 { 00022 int i, sign; 00023 00024 if ((sign = n) < 0) /* record sign */ 00025 n = -n; /* make n positive */ 00026 i = 0; 00027 do { /* generate digits in reverse order */ 00028 s[i++] = n % 10 + '0'; /* get next digit */ 00029 } while ((n /= 10) > 0); /* delete it */ 00030 if (sign < 0) 00031 s[i++] = '-'; 00032 s[i] = '\0'; 00033 reverse(s); 00034 } 00035 #endif
Generated on Thu Jul 14 2022 08:24:02 by
1.7.2