forked from cleanflight/cleanflight
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'betaflight/master' into betaflight-master
- Loading branch information
Showing
132 changed files
with
2,886 additions
and
948 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,3 +40,6 @@ stm32.mak | |
# artefacts for CLion | ||
/cmake-build-debug/ | ||
/CMakeLists.txt | ||
|
||
.vagrant | ||
ubuntu*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/* | ||
* This file is part of Cleanflight. | ||
* | ||
* Cleanflight is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Cleanflight is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with Cleanflight. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include <limits.h> | ||
|
||
#include "string_light.h" | ||
#include "typeconversion.h" | ||
|
||
int sl_isalnum(int c) | ||
{ | ||
return sl_isdigit(c) || sl_isupper(c) || sl_islower(c); | ||
} | ||
|
||
int sl_isdigit(int c) | ||
{ | ||
return (c >= '0' && c <= '9'); | ||
} | ||
|
||
int sl_isupper(int c) | ||
{ | ||
return (c >= 'A' && c <= 'Z'); | ||
} | ||
|
||
int sl_islower(int c) | ||
{ | ||
return (c >= 'a' && c <= 'z'); | ||
} | ||
|
||
int sl_tolower(int c) | ||
{ | ||
return sl_isupper(c) ? (c) - 'A' + 'a' : c; | ||
} | ||
|
||
int sl_toupper(int c) | ||
{ | ||
return sl_islower(c) ? (c) - 'a' + 'A' : c; | ||
} | ||
|
||
int sl_strcasecmp(const char * s1, const char * s2) | ||
{ | ||
return sl_strncasecmp(s1, s2, INT_MAX); | ||
} | ||
|
||
int sl_strncasecmp(const char * s1, const char * s2, int n) | ||
{ | ||
const unsigned char * ucs1 = (const unsigned char *) s1; | ||
const unsigned char * ucs2 = (const unsigned char *) s2; | ||
|
||
int d = 0; | ||
|
||
for ( ; n != 0; n--) { | ||
const int c1 = sl_tolower(*ucs1++); | ||
const int c2 = sl_tolower(*ucs2++); | ||
if (((d = c1 - c2) != 0) || (c2 == '\0')) { | ||
break; | ||
} | ||
} | ||
|
||
return d; | ||
} |
Oops, something went wrong.