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
// Function to convert a hexidecimal string to an integer | |
function hex2int(x) | |
{ | |
// Sanitize the string to all upper | |
local hex = x.tostring().toupper(); | |
// Create a lookup table for the hex digits, the index represents the decimal value | |
local hexChars = "0123456789ABCDEF"; | |
// Initialize a variable for the return value |
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
// Integer constants | |
const ACTIVE = 0; | |
const IDLE = 1; | |
// Hex constants | |
const READ = 0x80; | |
const WRITE = 0x00; | |
const BURST = 0x40; |
NewerOlder