Created
July 13, 2014 00:14
-
-
Save matrixd/a5823215d36d55b9c53c to your computer and use it in GitHub Desktop.
Ascii string to uint
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
uint8_t strToUint8(uint8_t length, uint8_t *charseq){ | |
uint8_t res = 0; | |
uint8_t n = 0; | |
while(length) { | |
length -= 1; | |
res += charseq[n] - 0x30 + (length*10); | |
n++; | |
}; | |
return res; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment