-
Notifications
You must be signed in to change notification settings - Fork 305
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Sarah Wang <sarah.wang_1@nxp.com>
- Loading branch information
Sarah Wang
committed
Jul 24, 2023
1 parent
5a9bb46
commit 15d2b96
Showing
8 changed files
with
354 additions
and
10 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 |
---|---|---|
|
@@ -14,4 +14,5 @@ CMakeCache.txt | |
*.clst | ||
*.snap | ||
node_modules | ||
build | ||
build | ||
*-lock.json |
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,6 @@ | ||
window.ZstdCodec = require('zstd-codec').ZstdCodec; | ||
require("zstd-codec/lib/module.js").run((binding) => {console.log("running", binding); window.binding = binding} ) | ||
// require("../libwebusb/module.js").run((binding) => {window.binding = binding} ) | ||
// require("./node_modules/zstd-codec/lib/module.js").run((binding) => {window.binding = binding} ) | ||
// window.binding = "test"; | ||
// window.fs = require('fs'); |
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,32 @@ | ||
import { useEffect, useState } from "react" | ||
import useDecompress from '../logic/useDecompress' | ||
import { DATA_SZ, BLK_SZ, PACKET_SZ } from "../helper/sparse"; | ||
|
||
const Decompress = () => { | ||
const [flashFile, setFlashFile] = useState(); | ||
const [{ | ||
requestUSBDevice, | ||
USBDevice, | ||
preBoot, | ||
send_chunk_headers, | ||
send_packet, | ||
send_flash, | ||
decompressFileToTransform, | ||
}] = useDecompress(flashFile); | ||
|
||
useEffect(()=> { | ||
console.log(ZstdCodec) | ||
console.log(window.binding); | ||
}, []) | ||
|
||
return ( | ||
<div> | ||
file to decompress: | ||
<input type="file" onChange={(e) => setFlashFile(e.target.files[0])}/> | ||
|
||
<button onClick={requestUSBDevice}>Pair USBDevice </button> | ||
</div> | ||
) | ||
} | ||
|
||
export default Decompress |
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
Oops, something went wrong.