Skip to content

Commit

Permalink
#12. cleaner UI
Browse files Browse the repository at this point in the history
  • Loading branch information
twatteyne committed Oct 20, 2021
1 parent 837e13a commit fc1d6c6
Show file tree
Hide file tree
Showing 6 changed files with 4,006 additions and 3,874 deletions.
8 changes: 6 additions & 2 deletions 01_software/scumprogrammer/InterfaceWeb.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,12 @@ def _webhandle_data_GET(self):
def _webhandle_action_POST(self):
cmdjson = bottle.request.json
elem = cmdjson['element'][len("button_"):-len("_rect")]
if elem=='bootload':
self.scumConnector.bootload(self.binfile)
if elem=='transfer':
self.scumConnector.transfer(self.binfile)
elif elem=='clear':
self.scumConnector.clear()
elif elem=='load':
self.scumConnector.load()
elif elem=='reset':
self.scumConnector.reset()
elif elem=='GPIOcal':
Expand Down
11 changes: 7 additions & 4 deletions 01_software/scumprogrammer/ScumConnector.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def get_isconnected(self):

#=== commands

def bootload(self,binfile):
def transfer(self,binfile):

# read file
with open(binfile,'rb') as f:
Expand All @@ -71,11 +71,14 @@ def bootload(self,binfile):
for (offset,chunk) in enumerate(chunks):
self.hdlc.send([self.CMD_CHUNK,offset%256,len(chunks)%256]+chunk)

# send load
self.hdlc.send([self.CMD_LOAD])

print('end ({:03f})'.format(time.time()-startts))

def clear(self):
self.hdlc.send([self.CMD_CLEAR])

def load(self):
self.hdlc.send([self.CMD_LOAD])

def reset(self):
self.hdlc.send([self.CMD_RESET])

Expand Down
2 changes: 1 addition & 1 deletion 01_software/scumprogrammer/static/scum.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function loadSvg() {
function buildPage() {

// buttons can be clicked
buttonNames = ["bootload","reset","GPIOcal"]
buttonNames = ["transfer","clear","load","reset","GPIOcal"]
for (var i in buttonNames) {
d3.select("#button_"+buttonNames[i]+"_rect")
.classed("button", true);
Expand Down
7,668 changes: 3,872 additions & 3,796 deletions 01_software/scumprogrammer/static/scumprogrammer_ui.ai

Large diffs are not rendered by default.

157 changes: 88 additions & 69 deletions 01_software/scumprogrammer/static/scumprogrammer_ui.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 32 additions & 2 deletions 02_firmware_nRF52840-DK/scum-programmer.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,41 @@ static bool cmd_handler_LOAD(uint8_t* cmd, uint8_t cmdLen) {
}

static bool cmd_handler_RESET(uint8_t* cmd, uint8_t cmdLen) {
return true; // TODO
bool returnVal;

returnVal = false;
do {
// check
if (cmdLen!=0) {
break;
}
returnVal = true;

// do
// TODO

} while(0);

return returnVal;
}

static bool cmd_handler_GPIOCAL(uint8_t* cmd, uint8_t cmdLen){
return true; // TODO
bool returnVal;

returnVal = false;
do {
// check
if (cmdLen!=1) {
break;
}
returnVal = true;

// do
// TODO

} while(0);

return returnVal;
}

//=== hdlc
Expand Down

0 comments on commit fc1d6c6

Please sign in to comment.