Advertisement
PT_

Untitled

PT_
Apr 29th, 2017
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. uint8_t outputByte;
  2.  
  3. // Get first part of hexadecimal
  4. tok = (uint8_t)ti_GetC(ice.inPrgm);
  5. if (tok >= t0 && tok <= t9) {
  6. outputByte = tok - t0;
  7. } else if (tok >= tA && tok <= tF) {
  8. outputByte = tok - tA + 0x0A;
  9. } else {
  10. return E_INVALID_ICON;
  11. }
  12. outputByte <<= 4;
  13.  
  14. // Get second part of hexadecimal
  15. tok = (uint8_t)ti_GetC(ice.inPrgm);
  16. if (tok >= 0 && tok <= t9) {
  17. outputByte |= tok - t0;
  18. } else if (tok >= tA && tok <= tF) {
  19. outputByte |= tok - tA + 0x0A;
  20. } else {
  21. return E_INVALID_ICON;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement