MCPcopy Create free account
hub / github.com/FastLED/FastLED / loadHex

Function loadHex

ci/docker_utils/avr8js/intelhex.ts:8–18  ·  view source on GitHub ↗
(source: string, target: Uint8Array)

Source from the content-addressed store, hash-verified

6 */
7
8export function loadHex(source: string, target: Uint8Array) {
9 for (const line of source.split("\n")) {
10 if (line[0] === ":" && line.substr(7, 2) === "00") {
11 const bytes = parseInt(line.substr(1, 2), 16);
12 const addr = parseInt(line.substr(3, 4), 16);
13 for (let i = 0; i < bytes; i++) {
14 target[addr + i] = parseInt(line.substr(9 + i * 2, 2), 16);
15 }
16 }
17 }
18}

Callers 1

constructorMethod · 0.90

Calls 2

parseIntFunction · 0.50
substrMethod · 0.45

Tested by

no test coverage detected