Skip to content

Commit

Permalink
adds flash at 50 utility
Browse files Browse the repository at this point in the history
  • Loading branch information
sphawes committed Apr 30, 2024
1 parent b0b6f1a commit f764009
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
# lumen-debug
WebSerial tool for testing and debugging a LumenPnP

```bash
npx vite preview

npx vite build --watch
```
18 changes: 18 additions & 0 deletions feederBus.js
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,24 @@ export class feederBus {
document.getElementById("feeder-scan").innerHTML="Scan";
}

async flashFifty(){
let response = await this.sendPacket(commands.GET_ID, 50)
if(response != false){
//we got somethin! is it an OK response?
if(response[5] == 0){
//grab uuid
let uuid = response.slice(6)

//send initialize with uuid
let initResponse = await this.sendPacket(commands.INITIALIZE, 50, uuid);

await this.sendPacket(commands.IDENTIFY_FEEDER, 0xFF, uuid);


}
}
}

async programSlotsUtility(){

let resp = await this.modal.show("Before Beginning", "To program your slots, first remove all Photon feeders from your machine. Once you've done this, click ok.\n\nIf at any point you'd like to exit this utility, click cancel.");
Expand Down
8 changes: 8 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,14 @@ <h3>CRC Tool</h3>


</div>

<div style="display:none;" class="feeder-pane" id="flash-at-fifty">
<h3>Flash at 50</h3>
<button id="flash-fifty-button">Flash</button>

</div>



</div>

Expand Down
5 changes: 5 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,11 @@ document.getElementById("more-controls").addEventListener("click", () => {
document.getElementById("broadcast").style.display = "block";
document.getElementById("custom-packet").style.display = "block";
document.getElementById("crc-tool").style.display = "block";
document.getElementById("flash-at-fifty").style.display= "block";
});

document.getElementById("flash-fifty-button").addEventListener("click", () => {
feeder.flashFifty();
});

//event delegation style listener for the feeder parent div, handling feeding and such from the parent
Expand Down

0 comments on commit f764009

Please sign in to comment.